Starting Activity Results Java.lang.runtimeexception
I have an activity in manifest: <
Solution 1:
You have intent.getAction()== null obviously.
Fix your line of code to:
mWasGetContentIntent = Intent.ACTION_GET_CONTENT.equals(intent.getAction());Solution 2:
Regarding this code:
Intent intent = getIntent();
mWasGetContentIntent = intent.getAction().equals( Intent.ACTION_GET_CONTENT);
It's best practice (and common sense) when using the .equals() to put what you know not to be null on the left side, so you avoid these NullPointerExceptions. So rewrite it to be:
mWasGetContentIntent = Intent.ACTION_GET_CONTENT.equals(intent.getAction());
Post a Comment for "Starting Activity Results Java.lang.runtimeexception"