Example usage for android.os RemoteException printStackTrace

List of usage examples for android.os RemoteException printStackTrace

Introduction

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

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:cx.ring.fragments.SmartListFragment.java

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    Conference transfer;/*  w w w .j  a  va 2s  . c o m*/
    if (requestCode == REQUEST_TRANSFER) {
        switch (resultCode) {
        case 0:
            Conference c = data.getParcelableExtra("target");
            transfer = data.getParcelableExtra("transfer");
            try {
                mCallbacks.getService().getRemoteService().attendedTransfer(
                        transfer.getParticipants().get(0).getCallId(), c.getParticipants().get(0).getCallId());
                mSmartListAdapter.notifyDataSetChanged();
            } catch (RemoteException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            Toast.makeText(getActivity(), getString(cx.ring.R.string.home_transfer_complet), Toast.LENGTH_LONG)
                    .show();
            break;

        case 1:
            String to = data.getStringExtra("to_number");
            transfer = data.getParcelableExtra("transfer");
            try {
                Toast.makeText(getActivity(),
                        getString(cx.ring.R.string.home_transfering,
                                transfer.getParticipants().get(0).getContact().getDisplayName(), to),
                        Toast.LENGTH_SHORT).show();
                mCallbacks.getService().getRemoteService()
                        .transfer(transfer.getParticipants().get(0).getCallId(), to);
                mCallbacks.getService().getRemoteService()
                        .hangUp(transfer.getParticipants().get(0).getCallId());
            } catch (RemoteException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            break;

        default:
            break;
        }
    } else if (requestCode == REQUEST_CONF) {
        switch (resultCode) {
        case 0:
            Conference call_to_add = data.getParcelableExtra("transfer");
            Conference call_target = data.getParcelableExtra("target");

            bindCalls(call_to_add, call_target);
            break;

        default:
            break;
        }
    } else {
        IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
        if (scanResult != null && resultCode == Activity.RESULT_OK) {
            String contact_uri = scanResult.getContents();
            startConversation(CallContact.buildUnknown(contact_uri));
        }
    }

}

From source file:com.mobileobservinglog.support.billing.DonationBillingHandler.java

public void startSetup(final OnSetupFinishedListener listener) {
    // If already set up, can't do it again.
    if (setupDone) {
        Log.d("InAppPurchase", "Setup was already done -- handler");
        return;// w  ww .  j  a  v  a 2 s  .  c o m
    }

    serviceConn = new ServiceConnection() {
        public void onServiceDisconnected(ComponentName name) {
            service = null;
        }

        public void onServiceConnected(ComponentName name, IBinder bindService) {
            service = IInAppBillingService.Stub.asInterface(bindService);
            String packageName = context.getPackageName();
            try {
                //Checking for in-app billing 3 support.
                int response = service.isBillingSupported(3, packageName, ITEM_TYPE_INAPP);
                if (response != BILLING_RESPONSE_RESULT_OK) {
                    if (listener != null)
                        listener.onSetupFinished(
                                new BillingHandlerResult(response, "Error checking for billing v3 support."));
                    return;
                }
                setupDone = true;
            } catch (RemoteException e) {
                if (listener != null) {
                    listener.onSetupFinished(new BillingHandlerResult(BILLINGHELPER_REMOTE_EXCEPTION,
                            "RemoteException while setting up in-app billing."));
                }
                e.printStackTrace();
            }

            if (listener != null) {
                listener.onSetupFinished(
                        new BillingHandlerResult(BILLING_RESPONSE_RESULT_OK, "Setup successful."));
            }
        }
    };
    context.bindService(new Intent("com.android.vending.billing.InAppBillingService.BIND"), serviceConn,
            Context.BIND_AUTO_CREATE);
}

From source file:com.terracom.mumbleclient.app.QRPushToTalkActivity.java

@Override
public boolean isConnected() {
    try {//  ww w  . j av  a  2  s  . c om
        return mService != null && mService.isConnected();
    } catch (RemoteException e) {
        e.printStackTrace();
        return false;
    }
}

From source file:com.terracom.mumbleclient.app.QRPushToTalkActivity.java

@Override
public void onBackPressed() {
    try {// w ww  .ja v a 2  s.c  om
        if (mService.isConnected()) {
            mDisconnectPromptBuilder.show();
            return;
        }
    } catch (RemoteException e) {
        e.printStackTrace();
    }
    super.onBackPressed();
}

From source file:com.terracom.mumbleclient.app.QRPushToTalkActivity.java

@Override
public String getConnectedServerName() {
    try {//from  www. jav  a2  s .  c o m
        if (mService != null && mService.isConnected()) {
            Server server = mService.getConnectedServer();
            return server.getName().equals("") ? server.getHost() : server.getName();
        }
    } catch (RemoteException e) {
        e.printStackTrace();
    }
    return null;
}

From source file:com.terracom.mumbleclient.app.QRPushToTalkActivity.java

@Override
protected void onPause() {
    super.onPause();
    if (mService != null)
        try {/*from   ww w  .j av a2s .  com*/
            mService.unregisterObserver(mObserver);
        } catch (RemoteException e) {
            e.printStackTrace();
        }
    unbindService(mConnection);
}

From source file:com.terracom.mumbleclient.app.QRPushToTalkActivity.java

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
    try {/*from   w w w.  j  a va2 s . co m*/
        if (Settings.ARRAY_INPUT_METHOD_PTT.equals(mSettings.getInputMethod())
                && keyCode == mSettings.getPushToTalkKey() && mService != null && mService.isConnected()) {
            if (!mService.isTalking() && !mSettings.isPushToTalkToggle()) {
                mService.setTalkingState(true);
            }
            return true;
        }
    } catch (RemoteException e) {
        e.printStackTrace();
    }
    return super.onKeyDown(keyCode, event);
}

From source file:info.guardianproject.otr.app.im.app.AccountListActivity.java

private void doHardShutdown() {

    for (IImConnection conn : mApp.getActiveConnections()) {
        try {//from  w w  w . java 2 s .co  m
            conn.logout();
        } catch (RemoteException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    Intent intent = new Intent(getApplicationContext(), WelcomeActivity.class);
    // Request lock
    intent.putExtra("doLock", true);
    // Clear the backstack
    intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
    startActivity(intent);
    finish();
}

From source file:com.terracom.mumbleclient.app.QRPushToTalkActivity.java

@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
    try {//w w  w .  ja v a2 s .  co  m
        if (Settings.ARRAY_INPUT_METHOD_PTT.equals(mSettings.getInputMethod())
                && keyCode == mSettings.getPushToTalkKey() && mService != null && mService.isConnected()) {
            if (!mSettings.isPushToTalkToggle() && mService.isTalking()) {
                mService.setTalkingState(false);
            } else {
                mService.setTalkingState(!mService.isTalking());
            }
            return true;
        }
    } catch (RemoteException e) {
        e.printStackTrace();
    }
    return super.onKeyUp(keyCode, event);
}

From source file:com.terracom.mumbleclient.app.QRPushToTalkActivity.java

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    if (mDrawerToggle.onOptionsItemSelected(item))
        return true;

    switch (item.getItemId()) {
    case R.id.action_disconnect:
        try {/*  w w  w. j av a2 s .co m*/
            getService().disconnect();
        } catch (RemoteException e) {
            e.printStackTrace();
        }
        return true;
    }

    return false;
}