Code example for ActivityNotFoundException

Methods: getMessage

0
            intent = new Intent(Main.ACTION_PICK_FILE);
            intent.putExtra(Main.EXTRA_TITLE, "Select File");
            intent.putExtra(Main.EXTRA_BUTTON_TEXT, "Open");
            startActivityForResult(intent, Main.RESULT_PICK_FILE);
        } catch (ActivityNotFoundException e){
            Log.e(TAG, e.getMessage());
            Toast.makeText(this, "Please install OI File Manager.", Toast.LENGTH_LONG).show();
            intent = new Intent(Intent.ACTION_VIEW);
            intent.setData(Uri.parse("market://search?q=filemanager openintents")); //pname:org.openintents.filemanager
            startActivity(intent);
        } 
    } 
}