My app has a nav header which displays the photo of user as well as a activity that shows one the output is shown properly on my laptop Emulator but does not show up when I run the app on a device no errors (checked to send a toast in case the info fetched is null did not trigger)
I also tried resizing the image to fit the image view using glide, the image is being saved in firebase storage and is given a URI which is saved in user's tree which is then accessed and called this all works on emulator but does not in a hand held device and I tried the other ways of running on Mobile Data in case its a router issue and different devices kindly help <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
code for the photo showing activity
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_id);
pfp=findViewById(R.id.picture);
fnameofstd=findViewById(R.id.idname);
numofstd=findViewById(R.id.idcon);
classofstd=findViewById(R.id.idclass);
lnameofstd=findViewById(R.id.idLname);
user=FirebaseAuth.getInstance().getCurrentUser();
reference= FirebaseDatabase.getInstance().getReference("users");
userID=user.getUid();
//takes val from database and feeds to places
reference.child(userID).addValueEventListener(new ValueEventListener()
{
@Override
public void onDataChange(@NonNull DataSnapshot snapshot)
{
RegisterUser reguser=snapshot.getValue(RegisterUser.class);
if (reguser!=null)
{
String FNAME= reguser.fname;
String LNAME= reguser.lname;
String NUMBER= reguser.phnumner;
String SUBJECT= reguser.stream;
fnameofstd.setText("First Name:- "+FNAME);
lnameofstd.setText("Last Name:- "+LNAME);
numofstd.setText("Mobile Number:- "+NUMBER);
classofstd.setText("Stream:- "+SUBJECT);
Glide.with(getApplicationContext()).load(reguser.getpfp()).centerCrop().into(pfp);
}
}
@Override
public void onCancelled(@NonNull DatabaseError error) {
Toast.makeText(IDActivity.this, "error", Toast.LENGTH_SHORT).show();
}
});
}
}