当前位置: 首页>>代码示例>>Java>>正文


Java OnNeverAskAgain类代码示例

本文整理汇总了Java中permissions.dispatcher.OnNeverAskAgain的典型用法代码示例。如果您正苦于以下问题:Java OnNeverAskAgain类的具体用法?Java OnNeverAskAgain怎么用?Java OnNeverAskAgain使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OnNeverAskAgain类属于permissions.dispatcher包,在下文中一共展示了OnNeverAskAgain类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onLoggerChangeNeverAskAgain

import permissions.dispatcher.OnNeverAskAgain; //导入依赖的package包/类
@OnNeverAskAgain(Manifest.permission.WRITE_EXTERNAL_STORAGE)
void onLoggerChangeNeverAskAgain() {
    fileLoggingLevelPreference.setValue(getString(R.string.preferences_file_logging_level_entries_value_disabled));
    new AlertDialog.Builder(getActivity())
            .setTitle(R.string.permission_denied)
            .setMessage(R.string.permission_logging_never_ask_again_message)
            .setCancelable(true)
            .setPositiveButton(R.string.dialog_permission_settings, new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    PermissionUtils.openAppSettings(getActivity());
                }
            })
            .setNegativeButton(R.string.dialog_cancel, null)
            .show();
}
 
开发者ID:zamojski,项目名称:TowerCollector,代码行数:17,代码来源:AdvancedPreferenceFragment.java

示例2: onNeverAskAgain

import permissions.dispatcher.OnNeverAskAgain; //导入依赖的package包/类
@OnNeverAskAgain(Manifest.permission.CAMERA)
void onNeverAskAgain() {
    new AlertDialog.Builder(this)
            .setPositiveButton(R.string.permission_go_settings, new DialogInterface.OnClickListener() {
                @Override
                public void onClick(@NonNull DialogInterface dialog, int which) {
                    Intent intent = new Intent();
                    intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
                    intent.addCategory(Intent.CATEGORY_DEFAULT);
                    intent.setData(Uri.parse("package:" + QRCodeScanActivity.this.getPackageName()));
                    intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY
                            | Intent.FLAG_ACTIVITY_SINGLE_TOP
                            | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);

                    startActivity(intent);
                }
            })
            .setCancelable(false)
            .setTitle(R.string.permission_dialog_title)
            .setMessage(R.string.permission_request_camera_denied)
            .show();
}
 
开发者ID:YieldNull,项目名称:Biu,代码行数:23,代码来源:QRCodeScanActivity.java

示例3: onNeverAskAgain

import permissions.dispatcher.OnNeverAskAgain; //导入依赖的package包/类
@OnNeverAskAgain({Manifest.permission.READ_PHONE_STATE, Manifest.permission.WRITE_EXTERNAL_STORAGE})
void onNeverAskAgain() {
    new AlertDialog.Builder(this)
            .setPositiveButton(R.string.permission_go_settings, new DialogInterface.OnClickListener() {
                @Override
                public void onClick(@NonNull DialogInterface dialog, int which) {
                    Intent intent = new Intent();
                    intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
                    intent.addCategory(Intent.CATEGORY_DEFAULT);
                    intent.setData(Uri.parse("package:" + MainActivity.this.getPackageName()));
                    intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY
                            | Intent.FLAG_ACTIVITY_SINGLE_TOP
                            | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);

                    startActivity(intent);
                }
            })
            .setCancelable(false)
            .setTitle(R.string.permission_dialog_title)
            .setMessage(R.string.permission_request_necessary_denied)
            .show();
}
 
开发者ID:YieldNull,项目名称:Biu,代码行数:23,代码来源:MainActivity.java

示例4: onNeverAskAgain

import permissions.dispatcher.OnNeverAskAgain; //导入依赖的package包/类
@OnNeverAskAgain(Manifest.permission.WRITE_EXTERNAL_STORAGE)
void onNeverAskAgain() {
    new AlertDialog.Builder(this)
            .setPositiveButton(R.string.permission_go_settings, new DialogInterface.OnClickListener() {
                @Override
                public void onClick(@NonNull DialogInterface dialog, int which) {
                    Intent intent = new Intent();
                    intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
                    intent.addCategory(Intent.CATEGORY_DEFAULT);
                    intent.setData(Uri.parse("package:" + ShareActivity.this.getPackageName()));
                    intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY
                            | Intent.FLAG_ACTIVITY_SINGLE_TOP
                            | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);

                    startActivity(intent);
                }
            })
            .setCancelable(false)
            .setTitle(R.string.permission_dialog_title)
            .setMessage(R.string.permission_request_storage_denied)
            .show();
}
 
开发者ID:YieldNull,项目名称:Biu,代码行数:23,代码来源:ShareActivity.java

示例5: showCameraPermissionDeniedForever

import permissions.dispatcher.OnNeverAskAgain; //导入依赖的package包/类
@OnNeverAskAgain({Manifest.permission.CAMERA})
void showCameraPermissionDeniedForever() {
    new AlertDialog.Builder(this)
            .setTitle(R.string.permission_dialog_title)
            .setMessage(R.string.permission_dialog_message)
            .setPositiveButton(R.string.ok, null)
            .setNegativeButton(R.string.cancel, null)
            .show();
}
 
开发者ID:BANKEX,项目名称:smart-asset-iot-android-demo,代码行数:10,代码来源:MainActivity.java

示例6: showLocationPermissionDeniedForever

import permissions.dispatcher.OnNeverAskAgain; //导入依赖的package包/类
@OnNeverAskAgain({Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION})
void showLocationPermissionDeniedForever() {
    if (isLocationPermissionDeniedForeverShown) {
        return;
    }
    isLocationPermissionDeniedForeverShown = true;
    new AlertDialog.Builder(this)
            .setTitle(R.string.permission_dialog_title)
            .setMessage(R.string.location_permission_not_granted_message)
            .setPositiveButton(R.string.ok, null)
            .show();
}
 
开发者ID:BANKEX,项目名称:smart-asset-iot-android-demo,代码行数:13,代码来源:MainActivity.java

示例7: onClick

import permissions.dispatcher.OnNeverAskAgain; //导入依赖的package包/类
@OnNeverAskAgain(Manifest.permission.CALL_PHONE)
//用户选择不再询问后的提示
    void showNotAsk() {
        new AlertDialog.Builder(this)
                .setMessage("该功能需要访问电话的权限,不开启将无法正常工作!")
                .setPositiveButton("确定", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                    }
                }).show();
    }
 
开发者ID:henrymorgen,项目名称:android-advanced-light,代码行数:12,代码来源:ThirdPartyActivity.java

示例8: onPermissionNeverAskAgain

import permissions.dispatcher.OnNeverAskAgain; //导入依赖的package包/类
/**
 * 当完全拒绝了权限打开之后调用
 */
@OnNeverAskAgain({Manifest.permission.BLUETOOTH_ADMIN, Manifest.permission.BLUETOOTH,
        Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION,
        Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE})
void onPermissionNeverAskAgain() {
    MyAlertDialog.showOpenSettingDialog(this, R.string.open_setting_permission);
}
 
开发者ID:Twelvelines,项目名称:AndroidMuseumBleManager,代码行数:10,代码来源:MainActivity.java

示例9: onClick

import permissions.dispatcher.OnNeverAskAgain; //导入依赖的package包/类
@OnNeverAskAgain(Manifest.permission.CAMERA)
//用户选择不再询问后的提示
 void showNotAsk()
 {
     new AlertDialog.Builder(context).setMessage("该功能需要摄像头权限,不开启将无法正常添加设备,只能手动在设置里面赋予权限")
             .setPositiveButton("确定", new DialogInterface.OnClickListener() {
                 @Override
                 public void onClick(DialogInterface dialog, int which) {
                 }
             }).show();


 }
 
开发者ID:dufangyu1990,项目名称:LeCatApp,代码行数:14,代码来源:MyFragment.java

示例10: showNotAsk

import permissions.dispatcher.OnNeverAskAgain; //导入依赖的package包/类
@OnNeverAskAgain(Manifest.permission.WRITE_EXTERNAL_STORAGE)
    //用户选择不再询问后的提示
void showNotAsk()
{
    new AlertDialog.Builder(this).setMessage("该功能需要读写文件权限,不开启将无法下载新版apk,需要手动去设置里面赋予权限")
            .setPositiveButton("确定", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                }
            }).show();
    mView.startAnim();


}
 
开发者ID:dufangyu1990,项目名称:LeCatApp,代码行数:15,代码来源:SplashActivity.java

示例11: onClick

import permissions.dispatcher.OnNeverAskAgain; //导入依赖的package包/类
@OnNeverAskAgain({
    Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_PHONE_STATE,
    Manifest.permission.RECORD_AUDIO
}) void showNeverAskForWriteExteralStorage() {
    new AlertDialog.Builder(getActivity()).setPositiveButton("好的",
        new DialogInterface.OnClickListener() {
            @Override public void onClick(DialogInterface dialog, int which) {
                startInstalledAppDetailsActivity(getActivity());
            }
        })
        .setNegativeButton("取消", null)
        .setCancelable(false)
        .setMessage("您已经禁止了存储空间/电话/麦克风权限中的一项或全部,是否现在去开启")
        .show();
}
 
开发者ID:plusend,项目名称:DiyCode,代码行数:16,代码来源:SettingsFragment.java

示例12: showNeverAskForLocation

import permissions.dispatcher.OnNeverAskAgain; //导入依赖的package包/类
@OnNeverAskAgain({Manifest.permission.WRITE_EXTERNAL_STORAGE})
void showNeverAskForLocation() {
    MyToast.showToast("文件读写权限已被拒绝");
    new AlertDialog.Builder(mContext).setTitle("提示")
            .setMessage("下载文件需要文件读写权限。\n\n请点击\"设置\"-\"权限管理\"-打开所需权限。")
            .setNegativeButton("取消", null)
            .setPositiveButton("设置", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    startAppSettings();
                }
            })
            .show();
}
 
开发者ID:lijunhuayc,项目名称:EasyFileDownloader,代码行数:15,代码来源:MainActivity.java

示例13: OnCameraNeverAskAgain

import permissions.dispatcher.OnNeverAskAgain; //导入依赖的package包/类
@OnNeverAskAgain(Manifest.permission.CAMERA)
void OnCameraNeverAskAgain() {
    canNeedsPermission = false;
    mSnackbar = Snackbar.make(findViewById(android.R.id.content), R.string.permission_camera_never_ask_again, Snackbar.LENGTH_INDEFINITE).setAction(R.string.setting, new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            UIHelper.showAppDetailSetting(HeartRateActivity.this);
        }
    });
    mSnackbar.show();

}
 
开发者ID:z-chu,项目名称:HeartRate,代码行数:13,代码来源:HeartRateActivity.java

示例14: showNeverAskForExternalStorage

import permissions.dispatcher.OnNeverAskAgain; //导入依赖的package包/类
@OnNeverAskAgain(Manifest.permission.WRITE_EXTERNAL_STORAGE)
void showNeverAskForExternalStorage() {
    if (isAdded()) {
        Utils.showPopup(IMAGE_POPUP_ID_IGNORE, getActivity(), this, getString(R.string.permission_externalstorage_denied_title), getString(R.string.permission_externalstorage_neverask), R.drawable.thumbs_down_circle, null);
    }
}
 
开发者ID:videgro,项目名称:Ships,代码行数:7,代码来源:ShowMapFragment.java

示例15: showNeverAskForLocation

import permissions.dispatcher.OnNeverAskAgain; //导入依赖的package包/类
@OnNeverAskAgain(Manifest.permission.ACCESS_FINE_LOCATION)
void showNeverAskForLocation() {
    if (isAdded()) {
        Utils.showPopup(IMAGE_POPUP_ID_IGNORE, getActivity(), this, getString(R.string.permission_location_denied_title), getString(R.string.permission_location_neverask), R.drawable.thumbs_down_circle, null);
    }
}
 
开发者ID:videgro,项目名称:Ships,代码行数:7,代码来源:ShowMapFragment.java


注:本文中的permissions.dispatcher.OnNeverAskAgain类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。