What i want to achieve is to tick the checkbox and when leaving the activity and returning the tick should stil be there. However now i tick it and when going to a different activity and returning the tick is gone. How can save the tick in the check box?
Here is my code:
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_tick, container, false);
CheckBox checkBox = (CheckBox) rootView.findViewById(R.id.checkBox62);
if(checkBox.isChecked())
checkBox.setChecked(false);
else
checkBox.setChecked(false);
return rootView;
}
}
Any help will be appreciated.