Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when activity launched with startActivityForResult() without ARG_CLOSEABLE extra #79

Open
gbak opened this issue Feb 9, 2018 · 1 comment

Comments

@gbak
Copy link

gbak commented Feb 9, 2018

Launching activity with the Intent/StartActivity will crash the app with a null pointer exception

02-08 15:45:36.311 27680 27680 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference
02-08 15:45:36.311 27680 27680 E AndroidRuntime: 	at com.nbsp.materialfilepicker.ui.FilePickerActivity.onCreateOptionsMenu(FilePickerActivity.java:187)
02-08 15:45:36.311 27680 27680 E AndroidRuntime: 	at android.app.Activity.onCreatePanelMenu(Activity.java:3396)
02-08 15:45:36.311 27680 27680 E AndroidRuntime: 	at android.support.v4.app.FragmentActivity.onCreatePanelMenu(FragmentActivity.java:321)

Launched with:

       val intent = Intent( activity, FilePickerActivity::class.java)
        intent.putExtra(FilePickerActivity.ARG_FILTER, Pattern.compile(".*\\.txt$"))
        startActivityForResult(intent, 1)

FilePickerActivity.java contains a Boolean which is never initialized if ARG_CLOSEABLE is never supplied as an Intent Extra.

gbak pushed a commit to gbak/MaterialFilePicker that referenced this issue Feb 9, 2018
gbak pushed a commit to gbak/MaterialFilePicker that referenced this issue Feb 9, 2018
@Rhygon
Copy link

Rhygon commented Jun 13, 2018

Surely deserves mentioned in on the main page, also fell foul to colorAccent, and colorPrimary etc, needing to be present in main apps resources, took all afternoon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants