you can still use
String Item = getIntent().getExtras().getString("name");
in the fragment
, you just need call getActivity()
first:
String Item = getActivity().getIntent().getExtras().getString("name");
This saves you having to write some code.
More Related Contents:
- How do I send WebView display page content to email body in android? [closed]
- application crashed due to regex function . which stops intent to switch from one to another activity [duplicate]
- How to start new activity on button click
- Communicating between a fragment and an activity – best practices
- How do I get the currently displayed fragment?
- Finish an activity from another activity
- How to switch activity without animation in Android?
- How to bring an activity to foreground (top of stack)?
- Error while Running Android Application – Could not initialize OpenglES emulation, use ‘-gpu off’ to disable it
- getView returning null when fragment has been created from an activity
- Android Fragment lifecycle over orientation changes
- How to make notification intent resume rather than making a new intent?
- Launch Skype from an App Programmatically & Pass Number – Android
- “Failure Delivering Result ” – onActivityForResult
- One Activity and all other Fragments [closed]
- What are the differences between activity and fragment?
- converting activity into fragment
- Intent – if activity is running, bring it to front, else start a new one (from notification)
- Start a fragment via Intent within a Fragment
- Trying to UNINSTALL_SHORTCUT but shortcut won’t go away
- Difference between extending LifecycleActivity,Activity,ActionbarActivity & AppCompactActivity?
- What is the meaning of android.intent.action.MAIN?
- Why does FLAG_ACTIVITY_CLEAR_TOP not work?
- android:configChanges=”orientation” does not work with fragments
- Kotlin Android start new Activity
- OnCreateView called multiple times / Working with ActionBar and Fragments
- Android: startActivityForResult & setResult for a view class and an activity class
- onActivityResult not call in the Fragment
- Activity stack ordering problem when launching application from Android app installer and from Home screen
- Android Fragment onCreateView vs. onActivityCreated