本文整理汇总了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);
}
示例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;
}
示例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);
}
示例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);
}
示例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();
}
示例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);
}
示例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);
}