i am going to made an application in which i use tab-view. for each tab i'm using a fragment,but when i'm going to perform any activity, no activity is performed.
public class Tab_1_Activity extends Fragment {
CheckBox Sunday_evening,Monday_morning,Monday_evening,Tuesday_morning,Tuesday_evening;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
final View rootView = inflater.inflate(R.layout.activity_tab_1, container, false);
Sunday_evening =(CheckBox) rootView.findViewById(R.id.check_sunday_evening);
Monday_morning =(CheckBox) rootView.findViewById(R.id.check_monday_morning);
Monday_evening =(CheckBox) rootView.findViewById(R.id.check_monday_evening);
Tuesday_morning=(CheckBox) rootView.findViewById(R.id.check_tuesday_morning);
Tuesday_evening= (CheckBox) rootView.findViewById(R.id.check_tuesday_evening);
//Monday Morning Checked condition
Monday_morning.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
if(b)
{
Sunday_evening.setChecked(false);
Monday_evening.setChecked(false);
Tuesday_morning.setChecked(false);
Tuesday_evening.setChecked(false);
}
else
{
Sunday_evening.setChecked(true);
Monday_evening.setChecked(true);
Tuesday_morning.setChecked(true);
Tuesday_evening.setChecked(true);
}
}
});
return inflater.inflate(R.layout.activity_tab_1, container, false);
}
}
Aucun commentaire:
Enregistrer un commentaire