I have a FragmentActivity where I add a Fragment. Depending on some situation, I want to access Buttons from that fragment\'s layout
FragmentActivity
Fragment
Buttons
Simply Use the getRootView() method to get the data of your fragment in Activity.
getRootView()
//below block of code write in activity. EditText et = (EditText) v.getRootView().findViewById(R.id.name); Log.d("Name", et.getText().toString());
name is the field of fragment.