Hi everyone,
I have downloaded new .apk file in /mnt/sdcard/download/ and i want to
install this apk by replacing my old(now using) apk because it is an
updated one.
This is my install method
public void installApplication(){
                 Uri packageURI = Uri.parse(PackageName.toString());
                 Intent updateintent = new
Intent(android.content.Intent.ACTION_VIEW, packageURI);
                 updateintent.setDataAndType(Uri.fromFile(new
File(Environment.getExternalStorageDirectory() + "/download/" +
fileName)), "application/vnd.android.package-archive");
                 startActivity(updateintent);

         }

And before that i uninstall application using this method
public void unInstallApplication()
            {
                 Uri packageURI = Uri.parse(PackageName.toString());
             Intent uninstallIntent = new Intent(Intent.ACTION_DELETE,
packageURI);
             startActivity(uninstallIntent);
            }

but when i try to install the application it says "Application not
installed" What is the error how can i fix it. Please help me

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to