String currentuser = FirebaseAuth.getInstance().getCurrentUser().getUid();
@Override
public void onLocationChanged(Location location) {
final Ticket ticket = new Ticket();
nameBusssLine = FirebaseDatabase.getInstance().getReference("Users");
nameBusssLine.child(currentuser).addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
String xx = dataSnapshot.child("bus_line").getValue().toString();
ticket.setBusLine(xx);
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
}
});
Toast.makeText(DriverHome.this, xx, Toast.LENGTH_SHORT).show();
Toast.makeText(DriverHome.this, ticket.getBusLine(), Toast.LENGTH_SHORT).show();
}