-
Notifications
You must be signed in to change notification settings - Fork 144
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
Fragment use: You must provide EXTRA_CONFIG when starting the DirectoryChooserActivity #80
Comments
Hey @Hofferic, thanks for the bug report. I'm a bit confused. Does this happen when using the chooser as a fragment or an activity? Since the error message can only be thrown from the activity I assume it's the latter, but your code is for a fragment. Can you clarify this for me? |
That is exactly what confuses me, I only use the above method and a nearly exact copy with slightly different permission handling in the onboarding activity. I only ever use the fragment and cannot explain for the life of me how the activity comes into this. Here is the second method I use to call the library: private void setDownloadFolder(){
if(!Globals.PERMISSION_STORAGE){
Hacks.coerceFullWidth(
Snackbar.make(findViewById(R.id.oobe_gestureOverlayView), R.string.snackbar_permission_storage, Snackbar.LENGTH_LONG)
).setAction(R.string.snackbar_permission_action, new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
intent.setData(android.net.Uri.parse("package:com.hoffmann.eric.calibrebox"));
startActivity(intent);
}
}).show();
return;
}
final DirectoryChooserConfig config = DirectoryChooserConfig.builder()
.newDirectoryName("EBooks")
.initialDirectory(getSharedPreferences(Globals.SETTINGS_NAME, MODE_PRIVATE).getString(Globals.DOWNLOAD_DIR,
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getPath()))
.allowNewDirectoryNameModification(true)
.allowReadOnlyDirectory(false)
.build();
mDialog = DirectoryChooserFragment.newInstance(config);
mDialog.show(getFragmentManager(), null);
} And here is the crash trace (as it is in onCreate I would guess it happens during configuration changes, as the dialog is only opened after the user clicks a button. But rotating while the fragment is open did not reproduce the issue on any of my test devices)
|
I just had an Idea where the Activity version is referenced - In the Manifest! <!-- file picker -->
<activity android:name="net.rdrei.android.dirchooser.DirectoryChooserActivity" /> Not sure if that contributes to this mysterious crash though :/ |
same problem! However, I use in Activity with your code so it work well. Thanks! |
I am using the dirchooser in Fragment mode and every so often I get crash reports originating form the IllegalArgumentException "You must provide EXTRA_CONFIG when starting the DirectoryChooserActivity". That exception is only thrown in the Activity version and I cannot for the life of me figure out how that gets involved in he process. The crash reports do tend to come from devices with tiny screens like the Defy Mini XT320 on older Android versions, but I am stumped how to solve this.
My calling code looks like this:
EDIT: I am using version 3.2 of the library
The text was updated successfully, but these errors were encountered: