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
Post a Comment