2
I have a main Activity (Mainactivity), which contains a list and a Navigationdrawer, when I click the register option is called this screen:
startActivity(new Intent(MainActivity.this, PessoasActivity.class));
And it works normally, but sometimes when I click on the option to return from the actionbar it closes the app, it happens more when I perform the save information operation in the bank. When I click on the option to return from the emulator and tmb on the device and close the app.
My Androidmanifest, Menu Log(Mainactivity) and Register(Personsacitivity):
<activity
android:name="com.aplicacao.app.MainActivity"
android:label="@string/app_name"
android:noHistory="true" >
</activity>
<activity
android:name="com.aplicacao.app.PessoasActivity"
android:label="@string/title_activity_pessoas" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.aplicacao.app.MainActivity" />
</activity>
Thiago, are you sure it’s not because of the attribute
noHistory="true"
in hisMainActivity
? With this attribute, theMainActivity
doesn’t stay in theBackStack
when starting anotherActivity
, causing the problem.– Wakim
I’ll remove and test.
– Thiago Porto
It worked, as I do to mark your comment as a response?
– Thiago Porto
I’ll create an answer and you can accept it.
– Wakim