Android : How to hide the Activity without using finish -


i'am calling activity broadcastreceiver. when phone ringing show activty. problem when use application if call means current activity not hiding.

so cannot see calling screen , cannot pick call. whatever activity have opened, want hide when call coming , again want show same activity.

before have used finish method in onreceive method. if use next time not calling broadcastreceiver.

instead of code can write hide activities.

@override public void onreceive(context context, intent intent) {     loginactivity.context.finish();     mainativity.context.finish();     projectactivity.context.finish();     telephonyregister(context,intent);  } 

try in activity.

  @override public boolean onkeydown(int keycode, keyevent event) {     if (keycode == keyevent.keycode_back) {         movetasktoback(true);         return true;     }     return super.onkeydown(keycode, event); } 

Comments

Popular posts from this blog

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -