I am update my app from server, first download from my server then ask for install after I select install then not ask for open or done why?
Explanation of my issue...
I have one app remember not in playstore. It store in my own server. I set update process for it.
My problem is 5th point.
Copy below code in Menifest.xml file
<receiver
android:name="com.example.extraApp.InstallReceiver"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.PACKAGE_INSTALL" />
<action android:name="android.intent.action.PACKAGE_ADDED" />
<data android:scheme="package"/>
</intent-filter>
</receiver>
Creat new java class copy below code in it
public class InstallReceiver extends BroadcastReceiver{
@Override
public void onReceive(Context context, Intent intent) {
try {
Intent new_intent = context.getPackageManager().getLaunchIntentForPackage("com.example.updaterjschtest");
context.startActivity(new_intent);
} catch (Exception e) {
e.printStackTrace();
}
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.