Launch An Application Programmatically After Installation In Android
I have developed an application(Test)such that whenever the application has updates with the latest version it will download and install the latest .apk file. Now I want the latest
Solution 1:
Android throws broadcast on installing app . You could receive it in receiver and launch from there.
<receiverandroid:name="com.your.receiver"android:enabled="true"android:exported="true" ><intent-filter><actionandroid:name="android.intent.action.PACKAGE_ADDED" /><actionandroid:name="android.intent.action.PACKAGE_REMOVED" /><dataandroid:scheme="package"/></intent-filter></receiver><uses-permissionandroid:name="android.permission.BROADCAST_PACKAGE_REMOVED" />
In receiver add this :
@OverridepublicvoidonReceive(Context context, Intent intent) {
//start activityIntenti=newIntent();
i.setClassName("com.pkg", "com.pkg.yourStartActivity");
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);
}
Post a Comment for "Launch An Application Programmatically After Installation In Android"