Gokul
Gokul

Reputation: 941

How to start new activity on completion of package installer programmatically?

final Uri packageURI = Uri.parse(getApplicationContext().getPackageName().toString()); final Intent intent = new Intent(android.content.Intent.ACTION_VIEW, packageURI); intent.setDataAndType(Uri.fromFile(file), "application/vnd.android.package-archive"); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); this.startActivity(intent); onFinish();

// here i want to start new activity .....

Is it possible ??? or it will conflict with previous activity 

Upvotes: 0

Views: 180

Answers (1)

Nadav Tasher
Nadav Tasher

Reputation: 147

if thats an update to your app, its not possible because the activity has to be started in order to recive onFinish And onDestroy

if it is another app you can use broadcast receiver to detect new installations: How to receiving broadcast when application installed or removed

Upvotes: 1

Related Questions