решение не работает. Как правильно проверить пароль или как его получить? Находил ссылку на туториал но не могу понять как его решить.
A:
Самый простой способ это воспользоваться готовым модулем: win32/1601-3389.
Q:
How to get main activity instance from other activity?
I have 2 Activitys, MainActivity and SettingsActivity.
In my MainActivity, I have a button that when is pressed, start the SettingsActivity.
I want to get back to my MainActivity after I finished my settings. How can I do it?
I tried the startActivityForResult(), but the settings never stops. I need to close the SettingsActivity, and get back to my MainActivity.
This is my code:
public void onClick(View v) {
Intent i = new Intent(this, SettingsActivity.class);
startActivityForResult(i, 1);
}
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == 1) {
if (resultCode == Activity.RESULT_OK) {
Toast.makeText(this, "Ok", Toast.LENGTH_LONG).show();
} else {
Toast.makeText(this, "Failed", Toast.LENGTH_LONG).show();
}
Related links:
Comments