nmnir
nmnir

Reputation: 578

Handle Activities programmatically

I have a class MyApp extends Application that should handle activities. After starting the activity with:

Intent dialogIntent = new Intent(getBaseContext(), ControlActivity.class);
dialogIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getApplication().startActivity(dialogIntent);

How to close it?

Upvotes: 0

Views: 45

Answers (1)

Seva Alekseyev
Seva Alekseyev

Reputation: 61396

You cannot, sorry. You don't get an Activity object from startActivity(). The best you can is open another activity with a flag that clears the running activities.

Upvotes: 1

Related Questions