Skip to content

improve the code #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion app/src/main/java/com/simcoder/uber/DriverMapActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ public void onClick(View v) {
case 2:
recordRide();
endRide();
// you have to reassigned this variable
status=0;
break;
}
}
Expand Down Expand Up @@ -185,6 +187,15 @@ public void onClick(View v) {
});
getAssignedCustomer();
}

// when the activity life cycle change
@Override
protected void onRestart() {
super.onRestart();
if (state == 0){
getAssignedCustomer();
}
}

private void getAssignedCustomer(){
String driverId = FirebaseAuth.getInstance().getCurrentUser().getUid();
Expand Down Expand Up @@ -541,4 +552,4 @@ private void erasePolylines(){
polylines.clear();
}

}
}