Start new Activity with button with FLAG_ACTIVITY_SINGLE_TOP on Android -


basically im trying start new activity button. problem in mainactivity class im using:

mpendingintent = pendingintent.getactivity(this, 0, new intent(this,             getclass()).addflags(intent.flag_activity_single_top), 0); 

i think thats reason why when im trying start new activity still can see mainactivity because still on top of screen. tried use this:

public void handleclick(view v){ //create intent start new activity. intent intent = new intent(); intent.setclass(this,page2activity.class); startactivity(intent);  } 

but still can't see new activity opened. way how can start new activity on top of screen? thank you.

what trying do?

to start new activity b activity have do:

intent = new intent(this, b.class); startactivity(i); 

you try set

i.setflags(intent.flag_activity_new_task) 

Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -