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


Java Dexter.checkPermissions方法代码示例

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


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

示例1: onFabButtonClicked

import com.karumi.dexter.Dexter; //导入方法依赖的package包/类
@OnClick(R.id.fab)
public void onFabButtonClicked() {
    AnalyticsManager.getInstance().trackSendIncidence();
    if (Dexter.isRequestOngoing()) {
        return;
    }
    Dexter.checkPermissions(cameraPermissionListener, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.CAMERA);
}
 
开发者ID:Mun0n,项目名称:MADBike,代码行数:9,代码来源:MapFragment.java

示例2: onCreateView

import com.karumi.dexter.Dexter; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_sos, container, false);
    ButterKnife.bind(this, view);

    sharedPreferences = getActivity().getSharedPreferences("Profile", MODE_PRIVATE);

    Dexter.checkPermissions(new MultiplePermissionsListener() {
        @Override
        public void onPermissionsChecked(MultiplePermissionsReport report) {/* ... */}

        @Override
        public void onPermissionRationaleShouldBeShown(List<PermissionRequest> permissions, PermissionToken token) {/* ... */}
    }, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION);

    LocationManager locationManager = (LocationManager) getActivity().getSystemService(Context.LOCATION_SERVICE);
    LocationListener locationListener = new MyLocationListener();
    try {
        if (locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER))
            locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 5000, 10, locationListener);
        else
            Toast.makeText(getContext(), "Enable location services", Toast.LENGTH_SHORT).show();
    } catch (SecurityException e) {
        Log.e("locationListener", e.toString());
    }

    return view;
}
 
开发者ID:adithya321,项目名称:SOS-The-Healthcare-Companion,代码行数:29,代码来源:SOSFragment.java

示例3: takePictureViaIntent

import com.karumi.dexter.Dexter; //导入方法依赖的package包/类
private void takePictureViaIntent() {
    if (Dexter.isRequestOngoing()) {
        return;
    }
    CompositeMultiplePermissionsListener listener = new CompositeMultiplePermissionsListener(permissionListener, anyPermissionDeniedListener);
    Dexter.checkPermissions(listener, Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE);
}
 
开发者ID:fzymek,项目名称:FunWithAndroid,代码行数:8,代码来源:MainActivity.java

示例4: onAllPermissionsButtonClicked

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

示例5: onCreate

import com.karumi.dexter.Dexter; //导入方法依赖的package包/类
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_init);
    ButterKnife.bind(this);
    setSupportActionBar(toolbar);
    setToolbar(toolbar);
    Dexter.checkPermissions(this, Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE);
    savedFragmentState(savedInstanceState);
    googleSingIn();
}
 
开发者ID:scott7462,项目名称:Udacity-Capstone-Project,代码行数:11,代码来源:ActivityInit.java

示例6: checkPermissionGalleryAndCamera

import com.karumi.dexter.Dexter; //导入方法依赖的package包/类
protected void checkPermissionGalleryAndCamera() {
    Dexter.checkPermissions(this, Manifest.permission.CAMERA, Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE);
}
 
开发者ID:scott7462,项目名称:Udacity-Capstone-Project,代码行数:4,代码来源:BasePickImageFragment.java

示例7: onCreate

import com.karumi.dexter.Dexter; //导入方法依赖的package包/类
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    initView();
    initPresenter();
    Dexter.checkPermissions(this, Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE);
}
 
开发者ID:scott7462,项目名称:Udacity-Capstone-Project,代码行数:7,代码来源:ActivityDoWorkout.java


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