-2
startActivity(new Intent(SecondScreen.this,FragmentOne.class).
putExtra("key", VideoFullUrl)); 

And in FragmentOne.class which extends android.support.v4.app.Fragment

      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    String   url = getIntent().getStringExtra("key");//here showing compilation error "cannot resolve method getIntent "
   //somecode....
Shwetabh Singh
  • 197
  • 5
  • 15
  • 1
    [http://stackoverflow.com/questions/16036572/how-to-pass-values-between-fragments](http://stackoverflow.com/questions/16036572/how-to-pass-values-between-fragments) – M D Mar 17 '16 at 07:32

1 Answers1

3

Fragment to Fragment set and get Argument:

Start Activity :

 int friendId = 2; //value to pass as extra 
 i = new Intent(firstActivity, SecondActivity.class);
 i.putExtra("friendsID", friendId);
 firstActivity.startActivity(i);

SecondActivity:

 Fragment_A mFragment_A = new Fragment_A();
 mFragment_A.setArguments(getIntent().getExtras());

Fragment_A:

Bundle bundle = new Bundle();
String Item = getArguments().getString("friendsID");
bundle.putInt("friendsID", Integer.parseInt(Item));

// code

Fragment_B mFragment_B = new Fragment_B();
mFragment_B.setArguments(bundle);

Fragment_B:

Bundle bundle = getArguments();
int value = bundle.getInt("friendsID");

Log.e("value Fragment get Argument ", "friendsID :" + value);

this work for me,try this may be this sample help you.

Adnan Amjad
  • 2,553
  • 1
  • 20
  • 29