fix app crash
This commit is contained in:
parent
91fa355d8c
commit
3ec08ab10f
1 changed files with 3 additions and 9 deletions
|
@ -33,24 +33,18 @@ public class TreatmentsFragment extends Fragment implements View.OnClickListener
|
|||
TextView treatmentsTab;
|
||||
TextView tempBasalsTab;
|
||||
|
||||
Fragment bolusFragment;
|
||||
Fragment tempBasalsFragment;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.treatments_fragment, container, false);
|
||||
|
||||
bolusFragment = new TreatmentsBolusFragment();
|
||||
tempBasalsFragment = new TreatmentsTempBasalsFragment();
|
||||
|
||||
treatmentsTab = (TextView) view.findViewById(R.id.treatments_treatments);
|
||||
tempBasalsTab = (TextView) view.findViewById(R.id.treatments_tempbasals);
|
||||
treatmentsTab.setOnClickListener(this);
|
||||
tempBasalsTab.setOnClickListener(this);
|
||||
context = getContext();
|
||||
|
||||
setFragment(bolusFragment);
|
||||
setFragment(new TreatmentsBolusFragment());
|
||||
|
||||
return view;
|
||||
}
|
||||
|
@ -60,10 +54,10 @@ public class TreatmentsFragment extends Fragment implements View.OnClickListener
|
|||
|
||||
switch (v.getId()) {
|
||||
case R.id.treatments_treatments:
|
||||
setFragment(bolusFragment);
|
||||
setFragment(new TreatmentsBolusFragment());
|
||||
break;
|
||||
case R.id.treatments_tempbasals:
|
||||
setFragment(tempBasalsFragment);
|
||||
setFragment(new TreatmentsTempBasalsFragment());
|
||||
break;
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue