tags:

views:

591

answers:

1

Hi,

In my android application, I start another activity using 'startActivity'. Is there anyway for me to kill that activity I started?

Thank you.

+1  A: 

You can stop the other activity by calling Activity.finish(). Alternatively, you can use Activity.finishActivity() to finish an activity started by startActivityForResult().

Daniel Lew
Thank you. I tried you suggestion. I did startActivityForResult(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com")), 1111);And then I did private Handler mHandler = new Handler() { @Override public void handleMessage(android.os.Message msg) { switch (msg.what) { case 1111: finishActivity(1111); break; } } };I see my debug statement, but the WebView Activity does not get killed.Any other idea?Thank you.
hap497