Show an alert/dialog when no appropriate file-manager was found

This commit is contained in:
litetex 2021-11-27 15:52:54 +01:00
parent ef91214085
commit f78983b16b
8 changed files with 114 additions and 20 deletions

View file

@ -0,0 +1,31 @@
package org.schabi.newpipe.streams.io;
import android.content.Context;
import androidx.appcompat.app.AlertDialog;
import org.schabi.newpipe.R;
/**
* Helper for when no file-manager/activity was found.
*/
public final class NoFileManagerHelper {
private NoFileManagerHelper() {
// No impl
}
/**
* Shows an alert dialog when no file-manager is found.
* @param context Context
*/
public static void showActivityNotFoundAlert(final Context context) {
new AlertDialog.Builder(context)
.setTitle(R.string.no_app_to_open_intent)
.setMessage(
context.getString(
R.string.no_appropriate_file_manager_message,
context.getString(R.string.downloads_storage_use_saf_title)))
.setPositiveButton(R.string.ok, null)
.show();
}
}