Reputation: 311
After I make a call with phone call intent and finish the call, the phone opens calls log instead of directly reopen the app activity which launches the call intent.
How do I skip going to the call log? After finishing the call I want the phone to come back to my app activity?
Upvotes: 0
Views: 836
Reputation: 11
launch/reopen the previous activity and set flag Intent.FLAG_ACTIVITY_SINGLE_TOP to the intent. if this flag set, the activity will not be launched if it is already running at the top of the history stack.
Upvotes: 1
Reputation: 311
Tried this to reopen app but the app crash
Intent i = new Intent("android.intent.action.MAIN");
i.setComponent(new ComponentName("com.muaz", "HantarSMS") );
i.addCategory("android.intent.category.LAUNCHER");
startActivity(i);
Upvotes: 0
Reputation: 3383
You can watch the Broadcast of android.intent.action.PHONE_STATE and for the extra EXTRA_STATE. If it is EXTRA_STATE_IDLE the call is finished and you can implement the logic to reopen your app
Upvotes: 0