开发者

does android OS creates new instance of Activity or brings up an old activity which has been pushed into the Activity stack

开发者 https://www.devze.com 2023-02-28 23:02 出处:网络
i m finding solution. my queston is for each startActivity(intent), does android OS creates newinstance 开发者_开发技巧of Activity or brings up an old activity which has been pushed into the Activity

i m finding solution. my queston is

for each startActivity(intent), does android OS creates new instance 开发者_开发技巧of Activity or brings up an old activity which has been pushed into the Activity stack.


It depends on the Flags that you set on the Intent, see: public Intent setFlags (int flags)


If what you want is to bring up the old activity, why don't you use PendingIntent.getActivity() it will get it and create it if it doesn't exist (unless you set the flag FLAG_NO_CREATE) you can check about it here http://developer.android.com/reference/android/app/PendingIntent.html

0

精彩评论

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

关注公众号