I want to invoke call action from my Activity, but after call action is finished my app stays on call log screen. To avoid this situation I decide to intent my activity from PhoneStateListener
, and I do it like this:
Intent intent = new Intent(MainActivity.this, MainActivity.class);
intent.setFlag(...);
startActivity(intent);
I tried many combination 开发者_Python百科of flags but only result I get was that my activity wasn't on the front of activity stack or I get new instance of my activity. How can I get my activity (the same instance) on the front of activity stack.
Have a read at the launchMode attribute for your Activity that can be set in the AndroidManifest. http://developer.android.com/guide/topics/manifest/activity-element.html#lmode
I believe what you're looking for is singleInstance.
How to Invoke/Start an application when a call is ended?
Please see this you can find the answer! in there change the package as in the answer!
精彩评论