0

My aim is to launch Email client on Android device using:

Intent regularIntent = getPackageManager().getLaunchIntentForPackage("com.android.email");

if (regularIntent == null) {

    Toast.makeText(getApplicationContext(),"This Email client not configured!",
                        Toast.LENGTH_LONG).show();
} else {

    regularIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);

    startActivityForResult(regularIntent,0);
}

I always get regularIntent as Null. What is a workaround for this issue?

4

0 回答 0