Code example for PackageManager.NameNotFoundException

Methods: printStackTrace

0
        ApplicationInfo appInfo = null;
        PackageManager packMgmr = getApplication().getPackageManager();
        try { 
            appInfo = packMgmr.getApplicationInfo(packageName, 0);
        } catch (NameNotFoundException e) {
            e.printStackTrace();
            throw new RuntimeException("Unable to locate assets, aborting...");
        } 
        apkFilePath = appInfo.sourceDir;
        Log.w("apk path", apkFilePath);
 
        // add this link at the renderer class 
        nativeSetPaths(apkFilePath);
    } 
      
    /** Called when the activity is first created. */ 
    @Override 
    public void onCreate(Bundle savedInstanceState)
    { 
        super.onCreate(savedInstanceState);
     // get the packageName,it's used to set the resource path