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:com.granita.tasks.SettingsListFragment.java

/**
 * This function is called to save the any modifications made to the displayed list. It retrieves the {@link HashMap} from the adapter of the list and uses
 * it makes the changes persistent. For this it uses a batch operation provided by {@link ContentResolver}. The operations to be performed in the batch
 * operation are stored in an {@link ArrayList} of {@link ContentProviderOperation}.
 * //w  ww .jav  a  2s  .  co  m
 * @return <code>true</code> if the save operation was successful, <code>false</code> otherwise.
 */
public boolean saveListState() {
    HashMap<Long, Boolean> savedPositions = ((VisibleListAdapter) getListAdapter()).getState();
    ArrayList<ContentProviderOperation> ops = new ArrayList<ContentProviderOperation>();

    for (Long posInt : savedPositions.keySet()) {
        boolean val = savedPositions.get(posInt);
        ContentProviderOperation op = ContentProviderOperation
                .newUpdate(TaskContract.TaskLists.getContentUri(mAutority))
                .withSelection(TaskContract.TaskLists._ID + "=?", new String[] { posInt.toString() })
                .withValue(mListCompareColumnName, val ? "1" : "0").build();
        ops.add(op);
    }

    try {
        mContext.getContentResolver().applyBatch(mAutority, ops);
    } catch (RemoteException e) {
        e.printStackTrace();
        return false;
    } catch (OperationApplicationException e) {
        e.printStackTrace();
        return false;
    }
    return true;
}

From source file:com.yangtsaosoftware.pebblemessenger.activities.ToolsFragment.java

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {

    switch (requestCode) {
    case REQUEST_SEND_MESSAGE: {
        Message msg = Message.obtain();// w  ww .j  av a 2  s . c o m
        Bundle b = new Bundle();
        msg.what = MessageProcessingService.MSG_NEW_MESSAGE;
        b.putString(MessageDbHandler.COL_MESSAGE_APP, LOG_TAG);
        b.putString(MessageDbHandler.COL_MESSAGE_CONTENT, data.getStringExtra(MESSAGE_BODY));
        try {
            msg.setData(b);
            rMessageProcessHandler.send(msg);
        } catch (RemoteException e) {
            e.printStackTrace();
            Constants.log(LOG_TAG, "Error when sending message to MessageProcessingService.");
        }
        Toast.makeText(_context, R.string.tools_toast_send_message, Toast.LENGTH_LONG).show();
    }
        break;
    case REQUEST_SEND_CALL:
        Intent inner_intent = new Intent(MessageProcessingService.class.getName());
        inner_intent.putExtra(Constants.BROADCAST_COMMAND, Constants.BROADCAST_CALL_INCOMING);
        inner_intent.putExtra(Constants.BROADCAST_PHONE_NUM, data.getStringExtra(CALL_NUM));
        inner_intent.putExtra(Constants.BROADCAST_NAME, data.getStringExtra(CALL_NAME));
        LocalBroadcastManager.getInstance(getActivity().getBaseContext()).sendBroadcast(inner_intent);
        Toast.makeText(_context, R.string.tools_toast_send_call, Toast.LENGTH_LONG).show();
        break;
    }

    super.onActivityResult(requestCode, resultCode, data);
}

From source file:com.morlunk.mumbleclient.channel.actionmode.UserActionModeCallback.java

private void showChannelMoveDialog() throws RemoteException {
    AlertDialog.Builder adb = new AlertDialog.Builder(mContext);
    adb.setTitle(R.string.user_menu_move);
    final List<Channel> channels = ModelUtils.getChannelList(mService.getRootChannel(), mService);
    final CharSequence[] channelNames = new CharSequence[channels.size()];
    for (int i = 0; i < channels.size(); i++) {
        channelNames[i] = channels.get(i).getName();
    }//from  w  ww . ja v  a 2  s  .c o m
    adb.setItems(channelNames, new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
            Channel channel = channels.get(which);
            try {
                mService.moveUserToChannel(mUser.getSession(), channel.getId());
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    });
    adb.show();
}

From source file:org.gateshipone.odyssey.fragments.SavedPlaylistsFragment.java

/**
 * Call the PBS to enqueue the selected playlist.
 * @param position the position of the selected playlist in the adapter
 *//*from w  ww. ja  va  2  s  . c o  m*/
private void enqueuePlaylist(int position) {
    // identify current playlist
    PlaylistModel clickedPlaylist = (PlaylistModel) mAdapter.getItem(position);

    try {
        // add playlist
        mServiceConnection.getPBS().enqueuePlaylist(clickedPlaylist.getPlaylistID());
    } catch (RemoteException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

From source file:org.yammp.app.MusicBrowserActivity.java

@Override
public boolean onPrepareOptionsMenu(Menu menu) {
    MenuItem item = menu.findItem(PLAY_PAUSE);
    try {/*from   w  w  w .j  a  v  a  2s.co  m*/
        if (item != null && mService != null)
            item.setIcon(
                    mService.isPlaying() ? R.drawable.ic_action_media_pause : R.drawable.ic_action_media_play);
    } catch (RemoteException e) {
        e.printStackTrace();
    }

    return super.onPrepareOptionsMenu(menu);
}

From source file:org.gateshipone.odyssey.fragments.SavedPlaylistsFragment.java

/**
 * Call the PBS to play the selected playlist.
 * @param position the position of the selected playlist in the adapter
 *//* w ww.  ja v  a 2s.c  o  m*/
private void playPlaylist(int position) {
    // identify current playlist
    PlaylistModel clickedPlaylist = (PlaylistModel) mAdapter.getItem(position);

    try {
        // clear the playlist
        mServiceConnection.getPBS().clearPlaylist();

        // add playlist
        mServiceConnection.getPBS().enqueuePlaylist(clickedPlaylist.getPlaylistID());

        // start playback
        mServiceConnection.getPBS().jumpTo(0);
    } catch (RemoteException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

From source file:com.example.seonoh2.smarttoliet01.beacon.RecoMonitoringActivity.java

private void unbind() {
    try {/*w  w w .j  a va2s.  c  o  m*/
        mRecoManager.unbind();
    } catch (RemoteException e) {
        Log.i("RecoMonitoringActivity", "Remote Exception");
        e.printStackTrace();
    }
}

From source file:org.gateshipone.odyssey.fragments.ArtistAlbumsFragment.java

/**
 * Call the PBS to enqueue artist.//w ww.  j a v  a  2 s.c  o m
 */
private void enqueueArtist() {
    // Read order preference
    SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(getContext());
    String orderKey = sharedPref.getString(getString(R.string.pref_album_sort_order_key),
            getString(R.string.pref_artist_albums_sort_default));

    // enqueue artist
    try {
        mServiceConnection.getPBS().enqueueArtist(mArtistID, orderKey);
    } catch (RemoteException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

From source file:edu.vuum.mocca.ui.tags.EditTagsFragment.java

public boolean setValuesToDefault() {

    TagsData tagsData;// w  w w  .  j a  va  2s  .  c o  m
    try {
        tagsData = resolver.getTagsDataViaRowID(getUniqueKey());
    } catch (RemoteException e) {
        Log.d(LOG_TAG, "" + e.getMessage());
        e.printStackTrace();
        return false;
    }

    if (tagsData != null) {
        Log.d(LOG_TAG, "setValuesToDefualt :" + tagsData.toString());
        // set the EditTexts to the current values
        loginIdET.setText(Long.valueOf(tagsData.loginId).toString());
        storyIdET.setText(Long.valueOf(tagsData.storyId).toString());
        tagET.setText(String.valueOf(tagsData.tag).toString());
        return true;
    }
    return false;
}

From source file:edu.vuum.mocca.ui.tags.EditTagsFragment.java

public void doSaveButtonClick() {
    Toast.makeText(getActivity(), "Updated.", Toast.LENGTH_SHORT).show();
    TagsData location = makeTagsDataFromUI();
    if (location != null) {
        try {//www . j  a v a2  s .com
            resolver.updateTagsWithID(location);
        } catch (RemoteException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            return;
        }
    } else {
        return;
    }
    if (getResources().getBoolean(R.bool.isTablet) == true) {
        mOpener.openViewTagsFragment(getUniqueKey());
    } else {
        getActivity().finish(); // same as hitting 'back' button
    }
}