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:ch.nexuscomputing.android.osciprimeics.OsciPrimeService.java

private void status() {
    try {// w  ww. ja  v  a 2s .co m
        mActivityMessenger.send(Message.obtain(null, OsciPrimeICSActivity.STATUS, mState, -1));
    } catch (RemoteException e) {
        e.printStackTrace();
    }
}

From source file:ch.nexuscomputing.android.osciprimeics.OsciPrimeService.java

@Override
public void startSampling() {
    try {//  w  ww  .  j  a  va  2s . co  m
        mServiceMessenger.send(Message.obtain(null, START));
    } catch (RemoteException e) {
        e.printStackTrace();
    }
}

From source file:ch.nexuscomputing.android.osciprimeics.OsciPrimeService.java

@Override
public void stopSampling() {
    try {//from w w w.j  av a  2s .  co m
        mServiceMessenger.send(Message.obtain(null, STOP));
    } catch (RemoteException e) {
        e.printStackTrace();
    }
}

From source file:org.musicmod.android.app.MusicBrowserActivity.java

private void updateNowplaying() {
    if (mService == null)
        return;//  w w w  . j  a v a  2  s  .c o  m
    try {
        if (mService.getAudioId() > -1 || mService.getPath() != null) {
            mPlayPauseButton.setVisibility(View.VISIBLE);
            mNextButton.setVisibility(View.VISIBLE);
            mTrackName.setText(mService.getTrackName());
            if (mService.getArtistName() != null
                    && !MediaStore.UNKNOWN_STRING.equals(mService.getArtistName())) {
                mTrackDetail.setText(mService.getArtistName());
            } else if (mService.getAlbumName() != null
                    && !MediaStore.UNKNOWN_STRING.equals(mService.getAlbumName())) {
                mTrackDetail.setText(mService.getAlbumName());
            } else {
                mTrackDetail.setText(R.string.unknown_artist);
            }
        } else {
            mPlayPauseButton.setVisibility(View.GONE);
            mNextButton.setVisibility(View.GONE);
            mTrackName.setText(R.string.music_library);
            mTrackDetail.setText(R.string.touch_to_shuffle_all);
        }
        if (mAlbumArtLoader != null)
            mAlbumArtLoader.cancel(true);
        mAlbumArtLoader = new AsyncAlbumArtLoader();
        mAlbumArtLoader.execute();
    } catch (RemoteException e) {
        e.printStackTrace();
    }
}

From source file:com.piusvelte.mosaic.android.MosaicMap.java

@Override
public void onPause() {
    super.onPause();
    if (iLocationService != null) {
        try {/*w ww  .  ja  v  a 2  s.c om*/
            iLocationService.setCallback(null);
        } catch (RemoteException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
    getActivity().unbindService(this);
}

From source file:com.piusvelte.mosaic.android.MosaicMap.java

@Override
public boolean onMarkerClick(Marker marker) {
    if (messages.containsKey(marker.getId())) {
        try {//from ww  w .  j av a 2  s . c  o  m
            iLocationService.getMessage(messages.get(marker.getId()));
        } catch (RemoteException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    } else
        marker.remove();
    return true;
}

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

@Override
public boolean onOptionsItemSelected(MenuItem item) {

    switch (item.getItemId()) {
    case R.id.menu_mute_button:
        try {/*from  w w  w.j  a  v  a2 s.com*/
            User self = getService().getSessionUser();

            boolean muted = !self.isSelfMuted();
            boolean deafened = self.isSelfDeafened();
            deafened &= muted; // Undeafen if mute is off
            self.setSelfMuted(muted);
            self.setSelfDeafened(deafened);
            getService().setSelfMuteDeafState(self.isSelfMuted(), self.isSelfDeafened());

            getActivity().supportInvalidateOptionsMenu();
        } catch (RemoteException e) {
            e.printStackTrace();
        }
        return true;
    case R.id.menu_deafen_button:
        try {
            User self = getService().getSessionUser();

            boolean deafened = self.isSelfDeafened();
            self.setSelfDeafened(!deafened);
            self.setSelfMuted(!deafened);
            getService().setSelfMuteDeafState(self.isSelfDeafened(), self.isSelfDeafened());

            getActivity().supportInvalidateOptionsMenu();
        } catch (RemoteException e) {
            e.printStackTrace();
        }
        return true;
    case R.id.menu_search:
        return false;
    /*case R.id.menu_bluetooth:
        item.setChecked(!item.isChecked());
        try {
            getService().setBluetoothEnabled(item.isChecked());
        } catch (RemoteException e) {
            e.printStackTrace();
        }
        return true; */
    }

    return super.onOptionsItemSelected(item);
}

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

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    inflater.inflate(R.menu.fragment_channel_list, menu);

    MenuItem searchItem = menu.findItem(R.id.menu_search);
    SearchManager searchManager = (SearchManager) getActivity().getSystemService(Context.SEARCH_SERVICE);

    final SearchView searchView = (SearchView) MenuItemCompat.getActionView(searchItem);
    searchView.setSearchableInfo(searchManager.getSearchableInfo(getActivity().getComponentName()));
    searchView.setOnSuggestionListener(new SearchView.OnSuggestionListener() {
        @Override/*www.j  a v  a 2  s  .c o m*/
        public boolean onSuggestionSelect(int i) {
            return false;
        }

        @Override
        public boolean onSuggestionClick(int i) {
            CursorWrapper cursor = (CursorWrapper) searchView.getSuggestionsAdapter().getItem(i);
            int typeColumn = cursor.getColumnIndex(SearchManager.SUGGEST_COLUMN_INTENT_EXTRA_DATA);
            int dataIdColumn = cursor.getColumnIndex(SearchManager.SUGGEST_COLUMN_INTENT_DATA);
            String itemType = cursor.getString(typeColumn);
            int itemId = cursor.getInt(dataIdColumn);
            if (ChannelSearchProvider.INTENT_DATA_CHANNEL.equals(itemType)) {
                try {
                    if (getService().getSessionChannel().getId() != itemId) {
                        getService().joinChannel(itemId);
                    } else {
                        scrollToChannel(itemId);
                    }
                } catch (RemoteException e) {
                    e.printStackTrace();
                }
                return true;
            } else if (ChannelSearchProvider.INTENT_DATA_USER.equals(itemType)) {
                scrollToUser(itemId);
                return true;
            }
            return false;
        }
    });
}

From source file:me.henrytao.bootstrapandroidlibrarydemo.activity.BaseActivity.java

private void requestItemsForPurchase(final AsyncCallback<List<PurchaseItem>> callback) {
    if (mPurchaseItems != null && mPurchaseItems.size() > 0) {
        if (callback != null) {
            callback.onSuccess(mPurchaseItems);
        }/*from  w w  w.j av  a2s  . com*/
        return;
    }
    new AsyncTask<IInAppBillingService, Void, AsyncResult<List<PurchaseItem>>>() {

        @Override
        protected AsyncResult<List<PurchaseItem>> doInBackground(IInAppBillingService... params) {
            List<PurchaseItem> result = new ArrayList<>();
            Throwable exception = null;
            IInAppBillingService billingService = params[0];

            if (billingService == null) {
                exception = new Exception("Unknow");
            } else {
                ArrayList<String> skuList = new ArrayList<>(Arrays.asList(mDonateItems));
                Bundle querySkus = new Bundle();
                querySkus.putStringArrayList("ITEM_ID_LIST", skuList);
                try {
                    Bundle skuDetails = billingService.getSkuDetails(3, getPackageName(), "inapp", querySkus);
                    int response = skuDetails.getInt("RESPONSE_CODE");
                    if (response == 0) {
                        ArrayList<String> responseList = skuDetails.getStringArrayList("DETAILS_LIST");
                        PurchaseItem purchaseItem;
                        for (String item : responseList) {
                            purchaseItem = new PurchaseItem(new JSONObject(item));
                            if (purchaseItem.isValid()) {
                                result.add(purchaseItem);
                            }
                        }
                    }
                } catch (RemoteException e) {
                    e.printStackTrace();
                    exception = e;
                } catch (JSONException e) {
                    e.printStackTrace();
                    exception = e;
                }
            }
            return new AsyncResult<>(result, exception);
        }

        @Override
        protected void onPostExecute(AsyncResult<List<PurchaseItem>> result) {
            if (!isFinishing() && callback != null) {
                Throwable error = result.getError();
                if (error == null && (result.getResult() == null || result.getResult().size() == 0)) {
                    error = new Exception("Unknow");
                }
                if (error != null) {
                    callback.onError(error);
                } else {
                    mPurchaseItems = result.getResult();
                    Collections.sort(mPurchaseItems, new Comparator<PurchaseItem>() {
                        @Override
                        public int compare(PurchaseItem lhs, PurchaseItem rhs) {
                            return (int) ((lhs.getPriceAmountMicros() - rhs.getPriceAmountMicros()) / 1000);
                        }
                    });
                    callback.onSuccess(mPurchaseItems);
                }
            }
        }
    }.execute(mBillingService);
}

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

private void stopRangingWithRegion(RECOBeaconRegion region) {
    Log.i("BackRangingService", "stopRangingWithRegion()");

    try {//w w w .  jav a 2s  .  co m
        mRecoManager.stopRangingBeaconsInRegion(region);
    } catch (RemoteException e) {
        Log.e("BackRangingService",
                "RemoteException has occured while executing RECOManager.stopRangingBeaconsInRegion()");
        e.printStackTrace();
    } catch (NullPointerException e) {
        Log.e("BackRangingService",
                "NullPointerException has occured while executing RECOManager.stopRangingBeaconsInRegion()");
        e.printStackTrace();
    }
}