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:me.henrytao.bootstrapandroidlibrarydemo.activity.BaseActivity.java

private void onDonate(PurchaseItem item) {
    if (item == null || !item.isValid() || mBillingService == null) {
        return;/*w  w  w  . j  a  v  a  2  s .  c o m*/
    }
    try {
        Bundle buyIntentBundle = mBillingService.getBuyIntent(3, getPackageName(), item.getId(), "inapp", "");
        PendingIntent pendingIntent = buyIntentBundle.getParcelable("BUY_INTENT");
        startIntentSenderForResult(pendingIntent.getIntentSender(), 1001, new Intent(), 0, 0, 0);
    } catch (RemoteException e) {
        e.printStackTrace();
    } catch (IntentSender.SendIntentException e) {
        e.printStackTrace();
    }
}

From source file:me.trashout.service.TrashHunterService.java

@Override
public void onCreate() {
    super.onCreate();
    Log.d("TrashHunter", "onCreate - this = " + this.toString());
    try {/* www.j  a v a 2  s  . co  m*/
        updateListener(true, null);
    } catch (RemoteException e) {
        e.printStackTrace();
    }
    setupLocationListener();
}

From source file:com.thunder.iap.IAPActivity.java

/**
 * returns the purchased items for a user
 * @param itemType//from w w w. j  a v a2s. c  o m
 * @param purchasedItemsListener
 */
public void getPurchasedItems(String itemType, PurchasedItemsListener purchasedItemsListener) {
    try {
        Bundle ownedItems = mService.getPurchases(3, getPackageName(), itemType, null);
        int response = ownedItems.getInt("RESPONSE_CODE");
        if (response == 0) {
            ArrayList<String> ownedSkus = ownedItems.getStringArrayList("INAPP_PURCHASE_ITEM_LIST");
            ArrayList<String> purchaseDataList = ownedItems.getStringArrayList("INAPP_PURCHASE_DATA_LIST");
            ArrayList<String> signatureList = ownedItems.getStringArrayList("INAPP_DATA_SIGNATURE_LIST");
            String continuationToken = ownedItems.getString("INAPP_CONTINUATION_TOKEN");
            Map<String, PurchasedItem> skuToPurchasedItem = new HashMap<String, PurchasedItem>();
            for (int i = 0; i < purchaseDataList.size(); ++i) {
                String purchaseData = purchaseDataList.get(i);
                String signature = signatureList.get(i);
                String sku = ownedSkus.get(i);
                // do something with this purchase information
                // e.g. display the updated list of products owned by user
                skuToPurchasedItem.put(sku, new PurchasedItem(purchaseData, signature, sku));
            }
            while (continuationToken != null) {
                try {
                    ownedItems = mService.getPurchases(3, getPackageName(), itemType, continuationToken);
                    response = ownedItems.getInt("RESPONSE_CODE");
                    if (response == 0) {
                        ownedSkus = ownedItems.getStringArrayList("INAPP_PURCHASE_ITEM_LIST");
                        purchaseDataList = ownedItems.getStringArrayList("INAPP_PURCHASE_DATA_LIST");
                        signatureList = ownedItems.getStringArrayList("INAPP_DATA_SIGNATURE_LIST");
                        continuationToken = ownedItems.getString("INAPP_CONTINUATION_TOKEN");
                        for (int i = 0; i < purchaseDataList.size(); ++i) {
                            String purchaseData = purchaseDataList.get(i);
                            String signature = signatureList.get(i);
                            String sku = ownedSkus.get(i);
                            // do something with this purchase information
                            // e.g. display the updated list of products owned by user
                            skuToPurchasedItem.put(sku, new PurchasedItem(purchaseData, signature, sku));
                        }
                    } else {
                        purchasedItemsListener.onServerError(ownedItems);
                    }
                } catch (RemoteException e) {
                    e.printStackTrace();
                    purchasedItemsListener.onError(e);
                }
            }
            // if continuationToken != null, call getPurchases again
            // and pass in the token to retrieve more items
        } else {
            purchasedItemsListener.onServerError(ownedItems);
        }
    } catch (RemoteException e) {
        e.printStackTrace();
        purchasedItemsListener.onError(e);
    }
}

From source file:com.terracom.mumbleclient.channel.ChannelListFragment.java

@Override
public void onServiceBound(IJumbleService service) {
    try {//from  w ww .j  a  v a  2  s.c om
        if (mChannelListAdapter == null)
            setupChannelList();
        else
            mChannelListAdapter.notifyDataSetChanged();
    } catch (RemoteException e) {
        e.printStackTrace();
    }
}

From source file:etsii_upm.obdii.EnviarService.java

private void consolaUpdate(String texto) {
    Message lMsg = new Message();
    lMsg.obj = texto;//from   ww  w .  j  a va 2s  .  co m
    try {
        messenger.send(lMsg);
    } catch (RemoteException e) {
        e.printStackTrace();
    }
}

From source file:mobilelecture.cdp12_app.RecoRangingActivity.java

private void unbind() {
    try {/* www .  j a va 2  s.  c  o  m*/
        mRecoManager.unbind();
    } catch (RemoteException e) {
        Log.i("RECORangingActivity", "Remote Exception");
        e.printStackTrace();
    }
}

From source file:com.ds.owl.dsdormitory.RecoBackgroundRangingService.java

private void tearDown() {
    Log.i("BackRangingService", "tearDown()");
    this.stopMonitoring();

    try {//from   ww  w  . ja va 2s  . c o m
        mRecoManager.unbind();
    } catch (RemoteException e) {
        Log.e("BackRangingService", "RemoteException has occured while executing unbind()");
        e.printStackTrace();
    }
}

From source file:com.torrenttunes.android.ui.FullScreenPlayerActivity.java

private void connectToSession(MediaSessionCompat.Token token) {

    try {//  ww  w.j  av  a  2 s.c  om

        mMediaController = new MediaControllerCompat(FullScreenPlayerActivity.this, token);

        if (mMediaController.getMetadata() == null) {
            finish();
            return;
        }

        mMediaController.registerCallback(mCallback);
        PlaybackStateCompat state = mMediaController.getPlaybackState();
        updatePlaybackState(state);
        MediaMetadataCompat metadata = mMediaController.getMetadata();
        if (metadata != null) {
            updateMediaDescription(metadata.getDescription());
            updateDuration(metadata);
        }
        updateProgress();
        if (state != null && (state.getState() == PlaybackStateCompat.STATE_PLAYING
                || state.getState() == PlaybackStateCompat.STATE_BUFFERING)) {
            scheduleSeekbarUpdate();
        }

    } catch (RemoteException e) {
        e.printStackTrace();
    }
}

From source file:com.a3did.partner.recosample.RecoBackgroundMonitoringService.java

private void stopMonitoring() {
    Log.i("BackMonitoringService", "stopMonitoring()");

    for (RECOBeaconRegion region : mRegions) {
        try {//from w  w w  .  ja va 2s  .  c om
            mRecoManager.stopMonitoringForRegion(region);
        } catch (RemoteException e) {
            Log.e("BackMonitoringService",
                    "RemoteException has occured while executing RECOManager.stopMonitoringForRegion()");
            e.printStackTrace();
        } catch (NullPointerException e) {
            Log.e("BackMonitoringService",
                    "NullPointerException has occured while executing RECOManager.stopMonitoringForRegion()");
            e.printStackTrace();
        }
    }
}

From source file:com.ariesmcrae.mymemories.ui.story.StoryViewFragment.java

private void deleteButtonPressed() {
    String message;//from   ww  w . ja va  2  s .c o  m

    message = getResources().getString(R.string.story_view_deletion_dialog_message);

    new AlertDialog.Builder(getActivity()).setIcon(android.R.drawable.ic_dialog_alert)
            .setTitle(R.string.story_view_deletion_dialog_title).setMessage(message)
            .setPositiveButton(R.string.story_view_deletion_dialog_yes, new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    try {
                        resolver.deleteAllStoryWithRowID(storyData.KEY_ID);
                    } catch (RemoteException e) {
                        Log.e(LOG_TAG, "RemoteException Caught => " + e.getMessage());
                        e.printStackTrace();
                    }
                    mOpener.openListStoryFragment();
                    if (getResources().getBoolean(R.bool.isTablet) == true) {
                        mOpener.openViewStoryFragment(-1);
                    } else {
                        getActivity().finish();
                    }
                }

            }).setNegativeButton(R.string.story_view_deletion_dialog_no, null).show();
}