private void stopProgress() {
   if (reqProgress != null && reqProgress.isShowing()) {
     reqProgress.dismiss();
   }
   if (reDialog != null && reDialog.isShowing()) {
     reDialog.dismiss();
   }
 }
Beispiel #2
0
 @Override
 protected void onDestroy() {
   // 判断对话框是否显示状态,显示中则销毁,避免 activity 的销毁导致错误
   if (createConversationDialog != null && createConversationDialog.isShowing()) {
     createConversationDialog.dismiss();
   }
   super.onDestroy();
 }
 @Override
 public void onPermissionNeedExplanation(String permissionName) {
   Log.i("NeedExplanation", "Permission( " + permissionName + " ) needs Explanation");
   if (!isSingle) {
     neededPermission = PermissionHelper.declinedPermissions(this, MULTI_PERMISSIONS);
     StringBuilder builder = new StringBuilder(neededPermission.length);
     if (neededPermission.length > 0) {
       for (String permission : neededPermission) {
         builder.append(permission).append("\n");
       }
     }
     result.setText("Permission( " + builder.toString() + " ) needs Explanation");
     AlertDialog alert = getAlertDialog(neededPermission, builder.toString());
     if (!alert.isShowing()) {
       alert.show();
     }
   } else {
     result.setText("Permission( " + permissionName + " ) needs Explanation");
     getAlertDialog(permissionName).show();
   }
 }