android - How to know pre Uninstall of my application -


i using below code running background in service pre uninstall event calling applications, don't require. want event application.

example: application "a" other applications "b","c"....

when tries uninstall "a" application want pre uninstall event.

but current code returning pre uninstall event other applications "b", "c".....

            // info running task             list<activitymanager.runningtaskinfo> taskinfo = mactivitymanager                     .getrunningtasks(10);              string activityname = taskinfo.get(0).topactivity                     .getclassname();              log.d("topactivity", "current activity ::" + activityname);              if (activityname                     .equals("com.android.packageinstaller.uninstalleractivity")) {                 // user has clicked on uninstall button under manage                 // apps settings                  // whatever pre-uninstallation task want perform                  toast.maketext(getapplicationcontext(),                         "warning!!! not supposed uninstall",                         toast.length_short).show();                 if (!mintimation) {                     startintimate();                     mintimation = true;                 }             } else {                 mintimation = false;             } 

thanks.

you can use this.

how receiving broadcast when application installed or removed

also check http://developer.android.com/reference/android/content/intent.html#action_package_removed


Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -