Skip to content

[Bug]: com.nareshchocha.filepickerlibrary.models.DocumentFilePickerConfig cannot be cast to android.content.Intent #73

@cobertgael

Description

@cobertgael

Describe the bug

hello
this is my java code to call the picker

launcher.launch(new DocumentFilePickerConfig());

private ActivityResultLauncher launcher = registerForActivityResult(
new ActivityResultContracts.StartActivityForResult(),
result -> {
if (result.getResultCode() == Activity.RESULT_OK) {
Uri uri = result.getData().getData();
// String filePath = result.getData().getStringExtra(Const.BundleExtras.FILE_PATH);
// Handle other scenarios (e.g., multiple picks) as needed
}
}
);

i have this error
com.nareshchocha.filepickerlibrary.models.DocumentFilePickerConfig cannot be cast to android.content.Intent
at androidx.activity.result.contract.ActivityResultContracts$StartActivityForResult.createIntent(ActivityResultContracts.kt:58)
at androidx.activity.ComponentActivity$activityResultRegistry$1.onLaunch(ComponentActivity.kt:176)
at androidx.activity.result.ActivityResultRegistry$register$2.launch(ActivityResultRegistry.kt:130)
at androidx.activity.result.ActivityResultLauncher.launch(ActivityResultLauncher.kt:37)
at fr.openmotion.secureangelmodel.gui.excel_import.ChooseAttachment.browseButton(ChooseAttachment.java:163)

Library Version

0.5.2

Steps to reproduce

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions