Skip to content

Commit

Permalink
write routine small bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
tanvir-ahmod committed May 7, 2017
1 parent deaddd9 commit 2afeb90
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ public void onItemClick(AdapterView<?> parent, View view, int position, long id)

RoutineStructure routine = currentDayData.get(position);
intent.putExtra("routine", routine);
intent.putExtra("day", cuurrentDayPosition);
startActivity(intent);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ protected void onCreate(Bundle savedInstanceState) {

storedKey = routine.getKey();

position = (int) extras.get("day");
day.setText(dayArray[position]);
delete.setVisibility(View.VISIBLE); //delete button is visibled
}

Expand Down Expand Up @@ -150,6 +152,7 @@ public void onClick(View v) {
if (isEditable == true) {
key = storedKey;
} else {
//store as new data
key = mFirebaseDatabase.push().getKey();
//isEditable = true; //next save will just overwrite the data

Expand Down Expand Up @@ -224,7 +227,7 @@ private void initialize() {
if (position == 7)
position = 0;

//day.setText(dayArray[position]);
day.setText(dayArray[position]);

mFirebaseDatabase = FirebaseDatabase.getInstance().getReference("routine");
}
Expand Down

0 comments on commit 2afeb90

Please sign in to comment.