Usage In Fragment
See original GitHub issueI can`t able to use this in fragment
Issue Analytics
- State:
- Created 7 years ago
- Comments:17 (5 by maintainers)
Top Results From Across the Web
Creating and Using Fragments | CodePath Android Cliffnotes
A fragment is a reusable class implementing a portion of an activity. A Fragment typically defines a part of a user interface. Fragments...
Read more >Fragments | Android Developers
Overview · Connect to the network · Manage network usage · Reading network state · Optimize network access · Optimize network data usage ......
Read more >Fragment Tutorial With Example In Android Studio
In Android, Fragment is a part of an activity which enable more modular activity design. It will not be wrong if we say...
Read more >Android - Fragments
First of all decide how many fragments you want to use in an activity. · Next based on number of fragments, create classes...
Read more >Building dynamic user interfaces in Android with fragments
A fragment is an independent Android component which can be used by an activity. A fragment encapsulates functionality so that it is easier...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
you started the activity using
.start(getActivity());
this way the result will only return in the activity, not in the fragment. If you use appcompat fragment (recomended) you can call.start(getContext(), this)
otherwise you need to call.getIntent(getContext())
and then use this intent to start the activity from your fragment.from my tests it looks like everything works.
Just to be sure you are not missing something. you should override the
onActivityResult
of the fragment to receive the result and if you did overrideonActivityResult
the result there will be received with different request code, so you must callsuper.onActivityResult(requestCode, resultCode, data);
to pass the result to the fragment.If this doesn’t answer you issue please provide more data than “not working”.