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


Java Dexter.checkPermission方法代码示例

本文整理汇总了Java中com.karumi.dexter.Dexter.checkPermission方法的典型用法代码示例。如果您正苦于以下问题:Java Dexter.checkPermission方法的具体用法?Java Dexter.checkPermission怎么用?Java Dexter.checkPermission使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.karumi.dexter.Dexter的用法示例。


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

示例1: initThings

import com.karumi.dexter.Dexter; //导入方法依赖的package包/类
private void initThings() {
    loadingManager = new LoadingManager(this);
    searchPresenter = new SearchPresenter(this);
    notificationManager = new NotificationManager(this);
    mGoogleApiClient = new GoogleApiClient.Builder(this)
            .enableAutoManage(this, 0 /* clientId */, this)
            .addApi(Places.GEO_DATA_API)
            .build();

    autoCompleteTextView.setOnItemClickListener(this);
    autoCompleteTextView.addTextChangedListener(this);
    autoCompleteTextView.setOnEditorActionListener(this);

    createPermissionListener();
    Dexter.checkPermission(locationPermissionListener, Manifest.permission.ACCESS_COARSE_LOCATION);

}
 
开发者ID:Mun0n,项目名称:MADBike,代码行数:18,代码来源:SearchActivity.java

示例2: onViewCreated

import com.karumi.dexter.Dexter; //导入方法依赖的package包/类
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    AnalyticsManager.getInstance().trackContentView("Map");
    mParties = getResources().getStringArray(R.array.states_values);
    setHasOptionsMenu(true);
    createPermissionListeners();
    initManagers();
    initMap(savedInstanceState);
    if (Dexter.isRequestOngoing()) {
        return;
    }
    Dexter.checkPermission(locationPermissionListener, Manifest.permission.ACCESS_COARSE_LOCATION);
    idStation = getArguments().getString(HomeActivity.STATION_ID);
}
 
开发者ID:Mun0n,项目名称:MADBike,代码行数:16,代码来源:MapFragment.java

示例3: onMissingPermEvent

import com.karumi.dexter.Dexter; //导入方法依赖的package包/类
/**
 * Called when something has indicated that we are missing a permission that we need.
 * @param event {@link MissingPermEvent}.
 */
@Subscribe
public final void onMissingPermEvent(MissingPermEvent event) {
    // Make sure we don't start another request if one is already happening.
    if (!Dexter.isRequestOngoing()) {
        // If the nag snackbar is shown, get rid of it first.
        SnackKiosk.dismissIfActionId(R.id.sb_action_retry_perms_check);
        // Store the ID of the action we wish to take if the permission is granted.
        onGrantedActionId = event.getActionId();
        // Currently we only have one permission we'd need to check for, write external storage, so we don't bother
        // checking the permission string in the event.
        Dexter.checkPermission(storagePL, Manifest.permission.WRITE_EXTERNAL_STORAGE);
    }
}
 
开发者ID:bkromhout,项目名称:Minerva,代码行数:18,代码来源:PermCheckingActivity.java

示例4: onCreate

import com.karumi.dexter.Dexter; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Applying activity layout
    setContentView(R.layout.activity_main);

    // Check for permission
    Dexter.checkPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);
    Dexter.checkPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE);

    ButterKnife.bind(this);
    Timber.tag(LOG_TAG);

    Timber.i("MainActivity created. Binding presenter...");
    mainPresenter = MainPresenterImpl.bind(this);

    int[] clickableViewIds = new int[]{
            R.id.buttonNegative,
            R.id.buttonPositive
    };

    for (int clickableViewId : clickableViewIds) {
        findViewById(clickableViewId)
                .setOnClickListener(this);
    }
}
 
开发者ID:dotWee,项目名称:ShareCrypter,代码行数:28,代码来源:MainActivity.java

示例5: askForPermission

import com.karumi.dexter.Dexter; //导入方法依赖的package包/类
@Override public void askForPermission(Permission permission,
    UserPermissionRequestResponseListener userResponse, Activity activity) {
  if (Dexter.isRequestOngoing()) {
    return;
  }

  PermissionListener[] listeners = createListeners(permission, userResponse, activity);

  Dexter.checkPermission(new CompositePermissionListener(listeners),
      permission.getAndroidPermissionStringType());

}
 
开发者ID:Gigigo-Android-Devs,项目名称:gigigo-utils-suite,代码行数:13,代码来源:AndroidPermissionCheckerImpl.java

示例6: askForPermission

import com.karumi.dexter.Dexter; //导入方法依赖的package包/类
@Override public void askForPermission(Permission permission,
    UserPermissionRequestResponseListener userResponse, Activity activity) {
  if (Dexter.isRequestOngoing()) {
    return;
  }

  PermissionListener[] listeners = createListeners(permission, userResponse, activity);

  Dexter.checkPermission(new CompositePermissionListener(listeners),
      permission.getAndroidPermissionStringType());
}
 
开发者ID:applivery,项目名称:applivery-android-sdk,代码行数:12,代码来源:AndroidPermissionCheckerImpl.java

示例7: onContactsPermissionButtonClicked

import com.karumi.dexter.Dexter; //导入方法依赖的package包/类
@OnClick(R.id.contacts_permission_button) public void onContactsPermissionButtonClicked() {
  if (Dexter.isRequestOngoing()) {
    return;
  }
  Dexter.checkPermission(contactsPermissionListener, Manifest.permission.READ_CONTACTS);
}
 
开发者ID:longtaoge,项目名称:Dexter,代码行数:7,代码来源:SampleActivity.java

示例8: onAudioPermissionButtonClicked

import com.karumi.dexter.Dexter; //导入方法依赖的package包/类
@OnClick(R.id.audio_permission_button) public void onAudioPermissionButtonClicked() {
  if (Dexter.isRequestOngoing()) {
    return;
  }
  Dexter.checkPermission(audioPermissionListener, Manifest.permission.RECORD_AUDIO);
}
 
开发者ID:longtaoge,项目名称:Dexter,代码行数:7,代码来源:SampleActivity.java

示例9: getAndGoWithPermissionWriteExternalStorage

import com.karumi.dexter.Dexter; //导入方法依赖的package包/类
/**
 * Checks for the permissions WRITE_EXTERNAL_STORAGE.
 * Will ask for this permissions, if granted (or not) will trigger the dedicated callbacks
 */
public void getAndGoWithPermissionWriteExternalStorage(){
    Dexter.checkPermission(mPermissionListenerWriteExternalStorage, Manifest.permission.WRITE_EXTERNAL_STORAGE);
}
 
开发者ID:pylapp,项目名称:SmoothClicker,代码行数:8,代码来源:PermissionsManager.java

示例10: getAndGoWithPermissionReadExternalStorage

import com.karumi.dexter.Dexter; //导入方法依赖的package包/类
/**
 * Checks for the permissions READ_EXTERNAL_STORAGE.
 * Will ask for this permissions, if granted (or not) will trigger the dedicated callbacks
 */
public void getAndGoWithPermissionReadExternalStorage(){
    Dexter.checkPermission(mPermissionListenerReadExternalStorage, Manifest.permission.READ_EXTERNAL_STORAGE);
}
 
开发者ID:pylapp,项目名称:SmoothClicker,代码行数:8,代码来源:PermissionsManager.java


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