此行中发生错误。
String value = dataSnapshot.getValue().toString();
其周围的代码为:
SharedPreferences sharedPreferences = getActivity().getSharedPreferences("email", Context.MODE_PRIVATE);
stUid = sharedPreferences.getString("uid", "");
stEmail = sharedPreferences.getString("email", "");
pbLogin = (ProgressBar)v.findViewById(R.id.pbLogin);
FirebaseDatabase database = FirebaseDatabase.getInstance();
DatabaseReference myRef = database.getReference();
myRef.child("users").child(stUid).addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
// This method is called once with the initial value and ag-ain
// whenever data at this location is updated.
String value = dataSnapshot.getValue().toString();
String stPhoto = dataSnapshot.child("photo").getValue().toString();
这是我的数据库表。