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