Chaining Android activities : install after uninstallation -


I want to uninstall a special APK and then I need to install another APK file. However, my app shows activity to uninstall and install one after each other, how can I solve this issue? I want the user to uninstall the APK and then install the new APK. Thanks a lot.

The following code I have tried

  Public Zero Uninstall and Install (View View) {/ * Try to uninstall the code * / try {intent = New intent (int. Action_deitE); Intent.setData (Uri.parse ("Package:" + ApplicationPackageName)); StartActivity; / * Code to install an app * / Intent Intent = New Intent (Intent.ACTION_VIEW); Intent.setDataAndType (Uri.fromFile (new file (SD card, "Android / Data / Com.Manpni.Android.games / temp / temp.apk")), "app / vnd.android.package-archive"); Intent.setFlags (Intent.FLAG_ACTIVITY_NEW_TASK); Context.startActivity; } Hold (exception e) {e.printStackTrace (); }}  

Try waiting until the package arrives, you uninstall the user You are requesting to do this before you begin the installation process of the next package.

Additionally, keep in mind that the user is not obliged to accept your uninstall request.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -