In Android application, does somebody know
what is the difference between :
- override onBackPressed in an Activity and startActivity vs
- put "android:parentActivityName" in manifest in the activity tag
Thanks
In Android application, does somebody know
what is the difference between :
Thanks
The system reads this attribute to determine which activity should be started when the use presses the Up button in the action bar. The system can also use this information to synthesize a back stack of activities with TaskStackBuilder.
This attribute was introduced in API Level 16.
means if you have three Activities A,B and C in your Appliction.you have set android:parentActivityName=".A" for Activity C in Manifast when you start Activity B from Activity A and C from Activity B.then user Press back button from activity C.user automatic go to Activity A instead of Activity B.
Called when the activity has detected the user's press of the back key. The default implementation simply finishes the current activity, but you can override this to do whatever you want.
called when user press Back key from any Activity. onBackPressed finish Current Activity and resume Previus one.for example if you start Activity B from Activity A and Activity C from Activity B. if user press back button from Activity C then System finish Current Activity C and Resume B.