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 phon开发者_运维技巧e to come back to my app activity?
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.
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
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);
精彩评论