Skip to content

Commit

Permalink
移除一些弹窗 IM-5312
Browse files Browse the repository at this point in the history
  • Loading branch information
jinfeng committed May 15, 2019
1 parent 458fc34 commit 7ede164
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions chatapp/src/main/java/jiguang/chat/activity/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ private void requestPermission() {
Manifest.permission.ACCESS_FINE_LOCATION,
Manifest.permission.ACCESS_WIFI_STATE,
Manifest.permission.RECORD_AUDIO)
.rationale(rationaleListener)
.callback(listener)
.start();
}
Expand Down Expand Up @@ -111,15 +110,15 @@ public void onFailed(int requestCode, List<String> deniedPermissions) {
}
};

private RationaleListener rationaleListener = (requestCode, rationale) -> {
AlertDialog.newBuilder(this)
.setMessage("正常使用JChat需要您打开相关权限.")
.setPositiveButton("是", (dialog, which) -> {
rationale.resume();
})
.setNegativeButton("否", (dialog, which) -> {
rationale.cancel();
}).show();
};
// private RationaleListener rationaleListener = (requestCode, rationale) -> {
// AlertDialog.newBuilder(this)
// .setMessage("正常使用JChat需要您打开相关权限.")
// .setPositiveButton("是", (dialog, which) -> {
// rationale.resume();
// })
// .setNegativeButton("否", (dialog, which) -> {
// rationale.cancel();
// }).show();
// };

}

0 comments on commit 7ede164

Please sign in to comment.