开发者

Doubt in android Activity navigation

开发者 https://www.devze.com 2023-03-02 09:55 出处:网络
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百科a

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...

0

精彩评论

暂无评论...
验证码 换一张
取 消