android - How to hide activities -
i have 2 activities. first activity running in foreground. while pressing home button, first activity goes background , calls service there second activity started using intent. first activity shown on top. want hide both of activities in background.
starting second activity
:
intent intent1 = new intent(xxx.this,yyy.class); intent1.addflags(intent.flag_activity_clear_top); intent1.addflags(intent.flag_activity_new_task); startactivity(intent1);
use service send intent second activity special value extra, override onnewintent , check see if value present; if there should stop activity use finish() function end activity(as can use movetasktoback(true) hide activity). highly recommend read this question.
Comments
Post a Comment