get intent not working in fragment 1

get intent not working in fragment

// add the getActivity() before getIntent and it should work perfectly 
// inside your fragment
Bundle bundle = getActivity().getIntent().getExtras();

Here is what the above code is Doing:
1. getActivity() returns the Activity this fragment is currently associated with.
2. getIntent() returns the intent this activity was started with.
3. getExtras() returns any extras that were included with the Intent.

Similar Posts