I've created an intent using
browserIntent =new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl));
How do I close it? Is it
browserIntent.close
or something... perhaps
browserIntent.finish(); ?
I've created an intent using
browserIntent =new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl));
How do I close it? Is it
browserIntent.close
or something... perhaps
browserIntent.finish(); ?
You cannot close another application's activities.
You can't.
Your intent starts a new application - browser. You can not close that application (browser) from with your activity.
Workarounds:
You could however put you activity in front from a service (call intent on your activity). The question is based on what user activity would you do that, since you are not receiving user events in service.
If you need user to view some web sites, you could use WebView. This is basically embedded browser that you can control.
You can't close an intent. An Intent
is just what it says - an intent, i.e. something you would like to. An intent by itself doesn't do anything. You're probably refering to an activity, which is the result of calling startActivity
on an Intent
.
You can't close somebody else's activity. You can just start a new one.