B
B
bezbunix2014-01-17 20:34:56
Android
bezbunix, 2014-01-17 20:34:56

How to implement return to activity after a call in Android?

I call in the activity in my call:

Intent myIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + number));
        myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        startActivityForResult(myIntent, 1);

But I can't figure out how to go back later. After me throws out in the log of calls.
Thanks in advance for the answers, I'm not strong in Android yet...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
constv, 2014-01-23
@bezbunix

Alternatively, in an activity in which

Intent myIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + number));
myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivityForResult(myIntent, 1);

also start the background service (in the manifest for the service, specify android:process=":remote"), subscribe to receive call status change events in it.
after
Intent myIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + number));
myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivityForResult(myIntent, 1);

add finish(), and in the service, upon completion of the call, display the desired activity, and stop it, in onDestroy unsubscribe from receiving events about changing the status of the call.
replace startActivityForResult with startActivity.

J
jstcdr, 2014-01-20
@jstcdr

try mIntent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question