Doubt in android Activity navigation
In my application, the first activity takes care of the splash screen/loader and onces it completes the load, a second activity comes up or starts.. Now when a person clicks on back or n开发者_JS百科avigates back, it is supposed to exit the application but it goes tthe loader or splash activity..how can i avoid this ?? Hope my question was clear...
When your application opens second screen aka second activity finish the first activity aka splash screen.
Just use finish()
method to achieve this.
Here is an example
Intent intent = new Intent();
intent.setClass(context, Second.class);
startActivity(intent );
//call finish
finish();
when you start second activity after then CurrentActivity.finish() current activity in your case like splash...
精彩评论