Skip to content

Commit

Permalink
change fragment based getContext() calls to getActivity()
Browse files Browse the repository at this point in the history
  • Loading branch information
symbyte committed Nov 10, 2015
1 parent 52f3a39 commit ef3c447
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
private void initUI(final View rootView) {
tvNote = (TextView) rootView.findViewById(R.id.tvNote);
tvNote.setText(sp.getString("attNote-"+studentName,"N/A"));
alert = new AlertDialog.Builder(getContext());
alert = new AlertDialog.Builder(getActivity());
String[] titles = new String[]{" Attendance ", " Absences "};
int[] values = new int[]{10, 4}; //absences
TextView tvStudentName = (TextView)rootView.findViewById(R.id.textView4);
Expand All @@ -141,11 +141,11 @@ private void initUI(final View rootView) {
addNote.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
LinearLayout layout = new LinearLayout(getContext());
LinearLayout layout = new LinearLayout(getActivity());
layout.setOrientation(LinearLayout.VERTICAL);
final EditText edittext = new EditText(getContext());
final EditText edittext = new EditText(getActivity());
edittext.setHint("Enter your note");
final DatePicker dp = new DatePicker(getContext());
final DatePicker dp = new DatePicker(getActivity());
layout.addView(edittext);
layout.addView(dp);
alert.setView(layout);
Expand Down

0 comments on commit ef3c447

Please sign in to comment.