本文整理汇总了Java中com.yanzhenjie.permission.RationaleListener类的典型用法代码示例。如果您正苦于以下问题:Java RationaleListener类的具体用法?Java RationaleListener怎么用?Java RationaleListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RationaleListener类属于com.yanzhenjie.permission包,在下文中一共展示了RationaleListener类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.yanzhenjie.permission.RationaleListener; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_gos_main);
context = GosMainActivity.this;
manager = new LocalActivityManager(this, true);
manager.dispatchCreate(savedInstanceState);
instance = this;
InitImageView();
initTextView();
initPagerViewer();
initHandler();
AndPermission.with(this)
.requestCode(REQUEST_CODE_SETTING)
.permission(Manifest.permission.ACCESS_FINE_LOCATION).rationale(new RationaleListener() {
@Override
public void showRequestPermissionRationale(int arg0, Rationale arg1) {
AndPermission.rationaleDialog(GosMainActivity.this, arg1).show();
}
})
.send();
}
开发者ID:gizwits,项目名称:GOpenSource_AppKit_Android_AS,代码行数:30,代码来源:GosMainActivity.java
示例2: onOptionsItemSelected
import com.yanzhenjie.permission.RationaleListener; //导入依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
// activity.logoutToClean();
// finish();
break;
case R.id.action_QR_code:
AndPermission.with(this)
.requestCode(REQUEST_ZXINGCODE_SETTING)
.permission(Manifest.permission.CAMERA).rationale(new RationaleListener() {
@Override
public void showRequestPermissionRationale(int arg0, Rationale arg1) {
AndPermission.rationaleDialog(GosMainActivity.this, arg1).show();
}
})
.send();
break;
case R.id.action_addDevice:
if (!checkNetwork(GosMainActivity.this)) {
Toast.makeText(GosMainActivity.this, R.string.network_error, 2000).show();
} else {
intent = new Intent(GosMainActivity.this, GosAirlinkChooseDeviceWorkWiFiActivity.class);
startActivity(intent);
}
break;
}
return super.onOptionsItemSelected(item);
}
开发者ID:gizwits,项目名称:GOpenSource_AppKit_Android_AS,代码行数:37,代码来源:GosMainActivity.java
注:本文中的com.yanzhenjie.permission.RationaleListener类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论