Android: On Configuration change or Orientation change


savedInstanceState will be null when the activity is created.

savedInstanceState will be not null when the activity is re created

check condition on the activity onCreate.

if (null == savedInstanceState) {
    // Add fragment to the activity
}

Comments

Popular posts from this blog

Working with Android Hierarchy Viewer

change svg android drawable color

Android: Standalone login with SQLiteOpenHelper