开发者

Is this the correct way to start an Activity?

Intent nnn = new Intent(Hello.this, NewActivity.class);
startActivity(nnn);
finish();

This would start a ne开发者_开发知识库w activity, and then close the current Activity forever, right?


yes. finish should stop the activity. The onDestroy() happens when its called.

http://developer.android.com/reference/android/app/Activity.html#finish%28%29


Yes,Calling finish() should stop your current activity and start new activity.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜