TedImagePicker icon indicating copy to clipboard operation
TedImagePicker copied to clipboard

Blank images on Android 10

Open DevAdeel opened this issue 5 years ago • 9 comments

Works fine till Android 9 but on Android 10 it shows blank images. All images are white.Whats the solution?

DevAdeel avatar Jul 04 '20 09:07 DevAdeel

I am facing the same issue

madgreasemonkey avatar Jul 20 '20 12:07 madgreasemonkey

Any solution to this problem?, i am facing the same issue.

ps-jimmy avatar Aug 06 '20 11:08 ps-jimmy

Any solution to this problem?, i am facing the same issue.

Use this attribute in application Tag of Manifest File

android:requestLegacyExternalStorage="true"

DevAdeel avatar Aug 06 '20 11:08 DevAdeel

I am facing the same issue

Use this attribute in application Tag of Manifest File

android:requestLegacyExternalStorage="true"

DevAdeel avatar Aug 06 '20 11:08 DevAdeel

I have android:requestLegacyExternalStorage="true" in manifest but it is not effecting on android 10, i target android 10.

ps-jimmy avatar Aug 07 '20 05:08 ps-jimmy

I came across this library implementation 'com.github.onimur:handle-path-oz:1.0.7' it support me to fix this issue for now.

ps-jimmy avatar Aug 09 '20 13:08 ps-jimmy

I came across this library implementation 'com.github.onimur:handle-path-oz:1.0.7' it support me to fix this issue for now.

Hello. Can you show or send some examples. How did you handled this bug

react1ve avatar Aug 10 '20 00:08 react1ve

I came across this library implementation 'com.github.onimur:handle-path-oz:1.0.7' it support me to fix this issue for now.

hey, can you tell us how did you use your solution ?

nasharty avatar Sep 22 '20 13:09 nasharty

Try to update to the latest version

implementation 'io.github.ParkSangGwon:tedimagepicker:1.2.7'

Then use the following lines of code. Checking if android is >10 and getting the Uri as follows sorted the issue

TedImagePicker.with(this)
                .errorListener(new OnErrorListener() {
                    @Override
                    public void onError(@NonNull Throwable throwable) {
                        Timber.e(throwable.getMessage());
                    }
                })
                .mediaType(MediaType.IMAGE)
                .start(uri -> {
                    File file = new File(uri.getPath());
                    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
                        String[] filePathColumn = {MediaStore.MediaColumns.DATA};
                        Cursor cursor = App.getContext().getContentResolver().query(
                                uri,
                                filePathColumn,
                                null,
                                null,
                                null);
                        if (cursor != null) {
                            if (cursor.moveToFirst()) {
                                int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
                                String absolutePathOfImage = cursor.getString(columnIndex);
                                if (absolutePathOfImage != null) {
                                    Uri.parse(absolutePathOfImage);
                                    file = new File(absolutePathOfImage);
                                }
                                cursor.close();
                            }
                        }
                    }
                });

ndungudedan avatar Jan 17 '22 13:01 ndungudedan