diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/UserDataActivity.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/UserDataActivity.java
index 79fcc09123..532dcc8962 100644
--- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/UserDataActivity.java
+++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/UserDataActivity.java
@@ -2,19 +2,22 @@
package org.dolphinemu.dolphinemu.activities;
+import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
+import android.widget.Button;
import android.widget.TextView;
+import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.utils.DirectoryInitialization;
-public class UserDataActivity extends AppCompatActivity
+public class UserDataActivity extends AppCompatActivity implements View.OnClickListener
{
public static void launch(Context context)
{
@@ -32,6 +35,7 @@ public class UserDataActivity extends AppCompatActivity
TextView textType = findViewById(R.id.text_type);
TextView textPath = findViewById(R.id.text_path);
TextView textAndroid11 = findViewById(R.id.text_android_11);
+ Button buttonOpenSystemFileManager = findViewById(R.id.button_open_system_file_manager);
textType.setText(DirectoryInitialization.isUsingLegacyUserDirectory() ?
R.string.user_data_old_location : R.string.user_data_new_location);
@@ -41,5 +45,35 @@ public class UserDataActivity extends AppCompatActivity
boolean show_android_11_text = Build.VERSION.SDK_INT >= Build.VERSION_CODES.R &&
!DirectoryInitialization.isUsingLegacyUserDirectory();
textAndroid11.setVisibility(show_android_11_text ? View.VISIBLE : View.GONE);
+
+ boolean show_file_manager_button = Build.VERSION.SDK_INT >= Build.VERSION_CODES.R;
+ buttonOpenSystemFileManager.setVisibility(show_file_manager_button ? View.VISIBLE : View.GONE);
+
+ buttonOpenSystemFileManager.setOnClickListener(this);
+ }
+
+ @Override
+ public void onClick(View v)
+ {
+ try
+ {
+ startActivity(getFileManagerIntent());
+ }
+ catch (ActivityNotFoundException e)
+ {
+ new AlertDialog.Builder(this, R.style.DolphinDialogBase)
+ .setMessage(R.string.user_data_open_system_file_manager_failed)
+ .setPositiveButton(R.string.ok, null)
+ .show();
+ }
+ }
+
+ private Intent getFileManagerIntent()
+ {
+ // Fragile, but some phones don't expose the system file manager in any better way
+ Intent intent = new Intent(Intent.ACTION_MAIN);
+ intent.setClassName("com.android.documentsui", "com.android.documentsui.files.FilesActivity");
+ intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ return intent;
}
}
diff --git a/Source/Android/app/src/main/res/layout/activity_user_data.xml b/Source/Android/app/src/main/res/layout/activity_user_data.xml
index dc7aa50fb9..4c8d3bfe45 100644
--- a/Source/Android/app/src/main/res/layout/activity_user_data.xml
+++ b/Source/Android/app/src/main/res/layout/activity_user_data.xml
@@ -39,7 +39,18 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/text_path"
- app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintBottom_toTopOf="@id/button_open_system_file_manager"
app:layout_constraintWidth_max="400dp" />
+
+
diff --git a/Source/Android/app/src/main/res/values/strings.xml b/Source/Android/app/src/main/res/values/strings.xml
index 5020e1b93e..af77bdbd86 100644
--- a/Source/Android/app/src/main/res/values/strings.xml
+++ b/Source/Android/app/src/main/res/values/strings.xml
@@ -328,7 +328,9 @@
User DataYour user data is stored in a location which will not be deleted when you uninstall the app:Your user data is stored in a location which will be deleted when you uninstall the app:
- Because you\'re using Android 11 or newer, you can\'t access this location using file manager apps. However, you can access it using the file manager in the system settings, or by connecting your device to a PC.
+ Because you\'re using Android 11 or newer, you can\'t access this location using file manager apps. However, you can access it using the system file manager, or by connecting your device to a PC.
+ Open System File Manager
+ Sorry, Dolphin couldn\'t find the system file manager on your device.Yes