Android Fundamentals V2 Learn points
There are some notable knowledge point which been found when I reviewed the Fundamentals.
- Activity manifest attribute:
android:parentActivityName=com.codeideal.demo.MainActivity:
this define a relationship between two activities for upward navigation. For old version(SDK_INT < 16 ), you can define a meta-data as follows:
1 | <activity android:name=".SecondActivity" |
There is a scene that when you click a notifcation to jump to a WebActivity to show promotion, and then you click back to back to the HomeActivity.
There are two situations :
- The App is on, click notification
- The App is off, click notification
In situations 1, we click back in the WebActivi ty, we don’t need rebuild the back stack and directly jump to HomeActivity.
In situations 2, we need to rebuild the back stack to go back to the HomeActivity
with These config, we can write thoes code to auto rebuild back stack to go to the HomeActivity:
1 |
|