Comments (4)
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?
from android-directorychooser.
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)
Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.hoffmann.eric.calibrebox/net.rdrei.android.dirchooser.DirectoryChooserActivity}: java.lang.IllegalArgumentException: You must provide EXTRA_CONFIG when starting the DirectoryChooserActivity.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)
at dalvik.system.NativeStart.main(NativeStart.java)
Caused by java.lang.IllegalArgumentException: You must provide EXTRA_CONFIG when starting the DirectoryChooserActivity.
at net.rdrei.android.dirchooser.DirectoryChooserActivity.onCreate(DirectoryChooserActivity.java:32)
at android.app.Activity.performCreate(Activity.java:5133)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)
at dalvik.system.NativeStart.main(NativeStart.java)
from android-directorychooser.
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 :/
from android-directorychooser.
same problem! However, I use in Activity with your code so it work well. Thanks!
from android-directorychooser.
Related Issues (20)
- Hidden directories are showing up. HOT 3
- crasch no activity found HOT 1
- Tip: Translations available HOT 1
- does not show big sd cards HOT 1
- App crashes with following stacktrace HOT 1
- language problem HOT 1
- java.lang.NoClassDefFoundError: Failed resolution of: Lcom/freshdesk/hotline/activity/InterstitialActivity
- gradle 1.0-pre-v11 dependency does not work HOT 1
- Crashing on Nexus 6P running Android 8 HOT 1
- Failed to resolve: com.gu:option:1.3 HOT 1
- Unresolved class in the Android Manifest HOT 2
- Uppercase directories sorted before lowercase
- Change title of DirectoryChooserActivity action bar?
- RuntimeException: Manifest merger failed with multiple errors, see logs HOT 1
- option
- Is there a dismissed event?
- Project is not updated. Waste of time. End of project
- Folders are not showing up HOT 1
- Any plans to migrate to androidx's fragments?
- Unresolved class in the Android Manifest
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-directorychooser.