i've a receiver that is fired on any application uninstall. I want to get the UID of the application . Currently i got the package name that was uninstalled but when i'm trying to get the UID, its returning null. Currently, i'm getting the UID of any package from following code.
public String getID(String pckg_name) {
ApplicationInfo ai = null;
String id = "";
try {
ai = pm.getApplicationInfo(pckg_name, 0);
id = "" + ai.uid;
} catch (final NameNotFoundException e) {
id = "";
}
return id;
}