[android-developers] Why would PackageManager throw PackageNotFound for its own App Package?

2012-02-07 Thread William Ferguson
I'm received several instances of the IllegalStateException being thrown out in the wild. It's very rare and I can't reproduce it locally. How is it possible for it to occur? NB Context below is this case is an Activity. final String packageName = context.getPackageName(); try { return

Re: [android-developers] Why would PackageManager throw PackageNotFound for its own App Package?

2012-02-07 Thread Mark Murphy
When are you calling this? One conceivable scenario would be if you are doing this a bit asynchronously from your activity (e.g., AsyncTask). If the user fired up your activity, then hustled over to uninstall it, *and* if the uninstall process were to update the package info before terminating