get Whatsapp Status Images and Videos in Android 11 by Using StorageManager

1.7k views Asked by At

by using this Stack OverFlow Answer (FOR SDK 30 AND ABOVE) I well able to retrieve the number of media files present in the .Status Folder on Android 11

But When I set the path to Imageview, image view Show Blanks

WAStatusModel fileItem = fileArrayList.get(i);
 File backupFile = new File( fileItem.getPath() );
        Uri imageUri = Uri.fromFile(backupFile);    
Glide.with(context)
                .load(imageUri)
                .into(viewHolder.imgpc);

I Also Try with the provider But no effect i.e

 Uri photoURI = FileProvider.getUriForFile(context, context.getPackageName() + ".provider", backupFile);
Glide.with(context)
                    .load(photoURI)
                    .into(viewHolder.imgpc);

My Output paths are:: imageUri is

 file:///storage/emulated/0/Android/media/com.whatsapp/WhatsApp/Media/.Statuses/img.jpg

fileItem.getUri() is

content://com.android.externalstorage.documents/tree/primary%3AAndroid%2Fmedia/document/primary%3AAndroid%2Fmedia%2Fcom.whatsapp%2FWhatsApp%2FMedia%2F.Statuses%2Fimg.jpg

and fileItem.getPath() is

/storage/emulated/0/Android/media/com.whatsapp/WhatsApp/Media/.Statuses/img.jpg

image is not Loaded in Adapter. How it is possible. Plz Help Me

0

There are 0 answers