To resume the fragment
press on backpress.On Backpress resume fragment in android.
I have the navigation drawer.fragment has replace from one layout to another. On back press want resume the fragment.
To resume the fragment:
public class ResumeFragment extends Fragment {
View view;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
view = inflater.inflate(R.layout.puser_registration, null);
Button btn_ok=(Button)view.findViewById(R.id.btn_ok);
EditText edit_text=(EditText)view.findViewById(R.id.edit_text);
btn_ok.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Ticket_generation fragment = new Ticket_generation();
FragmentManager fragmentManager = getActivity().getSupportFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.replace(R.id.drcontent_frame, fragment, "Second");
fragmentTransaction.commit();
}
});
return view;
}}
This fragment to resume in android.On back press resume the fragment in android.The edit edit value to stored.