Example usage for android.os RemoteException getCause

List of usage examples for android.os RemoteException getCause

Introduction

In this page you can find the example usage for android.os RemoteException getCause.

Prototype

public synchronized Throwable getCause() 

Source Link

Document

Returns the cause of this throwable or null if the cause is nonexistent or unknown.

Usage

From source file:com.commontime.plugin.LocationManager.java

private void stopMonitoringForRegion(final JSONObject arguments, final CallbackContext callbackContext) {

    _handleCallSafely(callbackContext, new ILocationManagerCommand() {

        @Override//from w w w  .j  a va2s.  c  o m
        public PluginResult run() {

            try {
                Region region = parseRegion(arguments);
                iBeaconManager.stopMonitoringBeaconsInRegion(region);

                PluginResult result = new PluginResult(PluginResult.Status.OK);
                result.setKeepCallback(true);
                return result;

            } catch (RemoteException e) {
                Log.e(TAG, "'stopMonitoringForRegion' service error: " + e.getCause());
                return new PluginResult(PluginResult.Status.ERROR, e.getMessage());
            } catch (Exception e) {
                Log.e(TAG, "'stopMonitoringForRegion' exception " + e.getCause());
                return new PluginResult(PluginResult.Status.ERROR, e.getMessage());
            }

        }
    });

}

From source file:com.commontime.plugin.LocationManager.java

private void stopRangingBeaconsInRegion(final JSONObject arguments, CallbackContext callbackContext) {
    _handleCallSafely(callbackContext, new ILocationManagerCommand() {

        @Override//  w  w w .ja v a 2 s .c  o m
        public PluginResult run() {

            try {
                Region region = parseRegion(arguments);
                iBeaconManager.stopRangingBeaconsInRegion(region);

                PluginResult result = new PluginResult(PluginResult.Status.OK);
                result.setKeepCallback(true);
                return result;

            } catch (RemoteException e) {
                Log.e(TAG, "'stopRangingBeaconsInRegion' service error: " + e.getCause());
                return new PluginResult(PluginResult.Status.ERROR, e.getMessage());
            } catch (Exception e) {
                Log.e(TAG, "'stopRangingBeaconsInRegion' exception " + e.getCause());
                return new PluginResult(PluginResult.Status.ERROR, e.getMessage());
            }
        }
    });

}

From source file:com.commontime.plugin.LocationManager.java

private void startRangingBeaconsInRegion(final JSONObject arguments, final CallbackContext callbackContext) {

    _handleCallSafely(callbackContext, new ILocationManagerCommand() {

        @Override//from  ww  w . j a va2s  . com
        public PluginResult run() {

            try {
                Region region = parseRegion(arguments);
                iBeaconManager.startRangingBeaconsInRegion(region);

                PluginResult result = new PluginResult(PluginResult.Status.OK);
                result.setKeepCallback(true);
                return result;

            } catch (RemoteException e) {
                Log.e(TAG, "'startRangingBeaconsInRegion' service error: " + e.getCause());
                return new PluginResult(PluginResult.Status.ERROR, e.getMessage());
            } catch (Exception e) {
                Log.e(TAG, "'startRangingBeaconsInRegion' exception " + e.getCause());
                return new PluginResult(PluginResult.Status.ERROR, e.getMessage());
            }
        }
    });
}

From source file:com.commontime.plugin.LocationManager.java

private void startMonitoringForRegion(final JSONObject arguments, final CallbackContext callbackContext) {

    _handleCallSafely(callbackContext, new ILocationManagerCommand() {

        @Override//from  w ww.  j a  v  a 2 s.c om
        public PluginResult run() {

            Region region = null;
            try {
                region = parseRegion(arguments);
                iBeaconManager.startMonitoringBeaconsInRegion(region);

                PluginResult result = new PluginResult(PluginResult.Status.OK);
                result.setKeepCallback(true);
                beaconServiceNotifier.didStartMonitoringForRegion(region);
                return result;

            } catch (RemoteException e) {
                Log.e(TAG, "'startMonitoringForRegion' service error: " + e.getCause());
                beaconServiceNotifier.monitoringDidFailForRegion(region, e);
                return new PluginResult(PluginResult.Status.ERROR, e.getMessage());
            } catch (Exception e) {
                Log.e(TAG, "'startMonitoringForRegion' exception " + e.getCause());
                beaconServiceNotifier.monitoringDidFailForRegion(region, e);
                return new PluginResult(PluginResult.Status.ERROR, e.getMessage());
            }

        }

    });
}