Search This Blog

Wednesday, 9 May 2012

how to give permisiion programatically in blackberry

Hello friends here is the code to prompt for the particular permission  in your app start up, in case if tht permission is not allowed.....nothing much to explain so see the code below :

Code:


ApplicationPermissionsManager manager = ApplicationPermissionsManager
        .getInstance();
    int current = manager
        .getPermission(ApplicationPermissions.PERMISSION_CROSS_APPLICATION_COMMUNICATION);
    if (current != ApplicationPermissions.VALUE_ALLOW) {
        ApplicationPermissions permissions = new ApplicationPermissions();
        permissions.addPermission(ApplicationPermissions.PERMISSION_CROSS_APPLICATION_COMMUNICATION);
        manager.invokePermissionsRequest(permissions);
    }

No comments:

Post a Comment