In the Activity I have :
public class tabsmain extends Activity{
public static Context appContext;
public boolean lf_ch=false;
public void onCreate(Bundle savedInstanceState){
I would like to access and possibly change lf_ch from a fragment inside tabsmain;
public class tabquests extends Fragment{
public CheckBox lc;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)//onCreateView
{
lc.setChecked(//set it to lf_ch);
However, I can't seem to access the value of lf_ch.
Try this:
public View onCreateView(...){
tabsmain xxx = (tabsmain)getActivity();
lc.setChecked(xxx.lf_ch);
}