mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-15 23:40:29 +02:00
Android: Fix UI background on scoped storage.
This commit is contained in:
1 parent
2ecaa61fa5
commit
dab1a3aa3c
1 file changed
+14
-7
@@ -1120,13 +1120,20 @@ public abstract class NativeActivity extends Activity {
|
||||
if (requestCode == RESULT_LOAD_IMAGE) {
|
||||
Uri selectedImage = data.getData();
|
||||
if (selectedImage != null) {
|
||||
String[] filePathColumn = {MediaStore.Images.Media.DATA};
|
||||
Cursor cursor = getContentResolver().query(selectedImage, filePathColumn, null, null, null);
|
||||
cursor.moveToFirst();
|
||||
int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
|
||||
String picturePath = cursor.getString(columnIndex);
|
||||
cursor.close();
|
||||
NativeApp.sendMessage("bgImage_updated", picturePath);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
NativeApp.sendMessage("bgImage_updated", selectedImage.toString());
|
||||
} else {
|
||||
String[] filePathColumn = {MediaStore.Images.Media.DATA};
|
||||
Cursor cursor = getContentResolver().query(selectedImage, filePathColumn, null, null, null);
|
||||
if (cursor != null) {
|
||||
cursor.moveToFirst();
|
||||
int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
|
||||
String picturePath = cursor.getString(columnIndex);
|
||||
cursor.close();
|
||||
|
||||
NativeApp.sendMessage("bgImage_updated", picturePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (requestCode == RESULT_OPEN_DOCUMENT) {
|
||||
Uri selectedFile = data.getData();
|
||||
|
||||
Reference in new issue
Block a user