I have some picture paths stored in a datastore and i am trying to convert them into drawables and display the in my image view, for some reason im getting a null pointer exception. Can someone please help me? Thanks
String pathName = selectedPlayer.getPicture();
Toast.makeText(this, pathName, Toast.LENGTH_SHORT).show();
Drawable d = Drawable.createFromPath(pathName);
imageView.setImageDrawable(d);
You must check file name is not null
then check that first if file exists or not
EDIT :
You have to initialize your imageview first like