I have an ActionBarActivity
and fragment. I am using FragmentPagerAdapter
that provides fragment to my app. My question How can I access parent Activit
At first, create a view like this:
View view = getActivity().findViewById(R.id.viewid);
Then convert it to any view that you need like this:
if( view instanceof EditText ) {
editText = (EditText) view;
editText.setText("edittext");
//Do your stuff
}
or
if( view instanceof TextView ) {
TextView textView = (TextView) view;
//Do your stuff
}