public static class AppSettingsDialog.Builder extends Object
AppSettingsDialog.| Constructor and Description |
|---|
Builder(android.app.Activity activity)
Create a new Builder for an
AppSettingsDialog. |
Builder(androidx.fragment.app.Fragment fragment)
Create a new Builder for an
AppSettingsDialog. |
| Modifier and Type | Method and Description |
|---|---|
AppSettingsDialog |
build()
Build the
AppSettingsDialog from the specified options. |
AppSettingsDialog.Builder |
setNegativeButton(int textId)
Set the negative button text, default is
R.string.cancel. |
AppSettingsDialog.Builder |
setNegativeButton(String text)
Set the negative button text, default is
R.string.cancel. |
AppSettingsDialog.Builder |
setOpenInNewTask(boolean openInNewTask)
Set whether the settings screen should be opened in a separate task.
|
AppSettingsDialog.Builder |
setPositiveButton(int textId)
Set the positive button text, default is
R.string.ok. |
AppSettingsDialog.Builder |
setPositiveButton(String text)
Set the positive button text, default is
R.string.ok. |
AppSettingsDialog.Builder |
setRationale(int rationale)
Set the rationale dialog.
|
AppSettingsDialog.Builder |
setRationale(String rationale)
Set the rationale dialog.
|
AppSettingsDialog.Builder |
setRequestCode(int requestCode)
Set the request code use when launching the Settings screen for result, can be retrieved
in the calling Activity's
Activity.onActivityResult(int, int, Intent) method. |
AppSettingsDialog.Builder |
setThemeResId(int themeResId)
Set the dialog theme.
|
AppSettingsDialog.Builder |
setTitle(int title)
Set the title dialog.
|
AppSettingsDialog.Builder |
setTitle(String title)
Set the title dialog.
|
public Builder(@NonNull
android.app.Activity activity)
AppSettingsDialog.activity - the Activity in which to display the dialog.public Builder(@NonNull
androidx.fragment.app.Fragment fragment)
AppSettingsDialog.fragment - the Fragment in which to display the dialog.@NonNull public AppSettingsDialog.Builder setThemeResId(@StyleRes int themeResId)
@NonNull public AppSettingsDialog.Builder setTitle(@Nullable String title)
@NonNull public AppSettingsDialog.Builder setTitle(@StringRes int title)
@NonNull public AppSettingsDialog.Builder setRationale(@Nullable String rationale)
@NonNull public AppSettingsDialog.Builder setRationale(@StringRes int rationale)
@NonNull public AppSettingsDialog.Builder setPositiveButton(@Nullable String text)
R.string.ok.@NonNull public AppSettingsDialog.Builder setPositiveButton(@StringRes int textId)
R.string.ok.@NonNull public AppSettingsDialog.Builder setNegativeButton(@Nullable String text)
R.string.cancel.
To know if a user cancelled the request, check if your permissions were given with EasyPermissions.hasPermissions(Context, String...) in Activity.onActivityResult(int, int, Intent). If you still don't have the right
permissions, then the request was cancelled.
@NonNull public AppSettingsDialog.Builder setNegativeButton(@StringRes int textId)
R.string.cancel.@NonNull public AppSettingsDialog.Builder setRequestCode(int requestCode)
Activity.onActivityResult(int, int, Intent) method.
Default is AppSettingsDialog.DEFAULT_SETTINGS_REQ_CODE.@NonNull public AppSettingsDialog.Builder setOpenInNewTask(boolean openInNewTask)
android.content.Intent#FLAG_ACTIVITY_NEW_TASK#FLAG_ACTIVITY_NEW_TASK on
the Intent used to open the settings screen.@NonNull public AppSettingsDialog build()
AppSettingsDialog from the specified options. Generally followed by a
call to AppSettingsDialog.show().