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

use in fragment #9

Closed
marzieNoor opened this issue Dec 12, 2022 · 5 comments
Closed

use in fragment #9

marzieNoor opened this issue Dec 12, 2022 · 5 comments

Comments

@marzieNoor
Copy link

marzieNoor commented Dec 12, 2022

Hi Atwa
how to use this methods in fragment?
when I use in fragment , I get this Err:

java.lang.IllegalStateException: LifecycleOwner MyPakageName.ui.MainActivity@69347ae is attempting to register while current state is RESUMED. LifecycleOwners must call register before they are STARTED.

thanks

@Atwa
Copy link
Owner

Atwa commented Dec 12, 2022

Hi @marzieNoor,
add this to the top of your fragment or in onCreate()
private val filePicker = FilePicker.getInstance(requireActivity())

Then use corresponding functions with filePicker instance but after ui is inflated

@Atwa Atwa closed this as completed Dec 12, 2022
@marzieNoor
Copy link
Author

marzieNoor commented Dec 12, 2022

I try it before but i got same Error and crashed my application

othewise when add this line to fragment , we have a 'Type mismatch' error:

Type mismatch.
Required:
AppCompatActivity
Found:
FragmentActivity

Even if we cast it to 'AppCompatActivity' or 'MainActivity', the crash problem will not be solved
and the previous error is still there

thanls

@Atwa
Copy link
Owner

Atwa commented Dec 12, 2022

@marzieNoor Oh sorry for such a bad experience.
Will resolve it and update you ASAP

@Atwa Atwa reopened this Dec 12, 2022
@marzieNoor
Copy link
Author

@Atwa
thank you Awta

@Atwa
Copy link
Owner

Atwa commented Mar 5, 2023

Hi @marzieNoor You can now use the library with fragments safely the same way you initialize it in activity.

@Atwa Atwa closed this as completed Mar 5, 2023
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