Android : How to disable back button to Splash Screen Activity

Points To Remember


  • Ideally splash screen should be shown only at the start on the Android Application.
  • Application should not go back to the Splash screen when back button is pressed

How to disable back button to Splash Screen Activity

In order to disable your application to go back to the your can do the following

  • Disable the Back Button on the Activity called just after the Splash Screen.
  • Remove the Splash Activity from Application life-cycle/history.
You can disable the back button on any activity programmatically using the following  

@Override
public void onBackPressed() {
}

You can also do the same by disabling back to activity by removing it from history in AndroidManifest.xml

<activity android:name=".SplashActivity" android:noHistory="true"/>

No comments :

Post a Comment