I have fragments for 3 states of a screen; Add, Edit and View. In Add, I create an entity and save it. Next time I open it in View mode and set the entity name using
According to the @TusharVengrulekar , this is how you must implement your Fragment
public class ActionBar extends Fragment {
private TextView lbl_title;
private String title;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_action_bar, container, false);
title = "Contacts";
lbl_title = (TextView) view.findViewById(R.id.lbl_title);
return view;
}
@Override
public void onStart(){
super.onStart();
lbl_title.setText(title);
}
@Override
public void onResume(){
super.onResume();
}
}