Tuesday, September 3, 2013

Android Tutorial: Start Another Activity


For this section, I know most of the knowledge the author mentioned, but there are still 3 things I can learn.

1, Using Build Class to check the current version of SDK is very helpful.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
2, These is a better implementation of action code when an activity's Action Bar go up button clicked.
case android.R.id.home:
     NavUtils.navigateUpFromSameTask(this);
     return true;
3, In Android Manifest.xml file, developer could easily set the parent activity (android:parentActivityName) of current activity class. The <meta-data> code is used for
android:parentActivityName="com.example.myfirstapp.MainActivity" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.example.myfirstapp.MainActivity" />

No comments :

Post a Comment