Android PackageManger - NameNotFound Exception
<p>I am using a <code>BroadcastReceiver</code> to register for package added event and as soon as I get that event I call package manager with getApplicationInfo to get more ifnormation about the package installed. At this time I receive namenoutfoundexception and I believe it is because the packagemanager has not updated the data and I got the event before it. how do I resolve this? Any ideas?</p>

<p>My code: </p>

<pre><code> public void onReceive(Context context, Intent intent) {
            // Launch the activity for showing reputation of application
        Intent intent1 = new Intent(ApplicationListViewActivity.this,AppViewActivity.class);

        //Next create the bundle and initialize it
        Bundle bundle = new Bundle();
        String pkgName = intent.getData().toString();
        //Add the parameters to bundle as 
        bundle.putString("pkgName",pkgName);
        //Add this bundle to the intent
        intent1.putExtras(bundle);
        startActivity(intent1);
}

try {
            ApplicationInfo ai = pm.getApplicationInfo(pkgName, PackageManager.GET_META_DATA);

} catch (NameNotFoundException e) {

{//end up here}
</code></pre>
