If I have Fragment A and Fragment B. I call Fragment B from A using below code
FragmentManager fragmentManager =getFragmentManager();
FragmentTransaction fragmentTransaction =
fragmentManager.beginTransaction();
fragmentTransaction.add(R.id.frame_step, fragment,TAG).hide(SourceFragment.this).addToBackStack((SourceFragment.class.getName()));
fragmentTransaction.commit();
Now in Fragment B I have EditText & I have entered "Hello" in it, if I press back button from Fragment B then according to getSupportFragmentManager().popBackStack();
it will resume Fragment A
Now if I again call Fragment B from Fragment A I want that FragmentB will not get created again and still I can see "Hello" inside EditText.
Note -- I do not want to use variables or shared pref for this as i have multiple fragments with multiple views like a big form. Is there anything that can just call fragment from its resume state instead of calling it again or if i can check if this fragment has already created . Thanks in advance