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.morlunk.mumbleclient.channel.actionmode.UserActionModeCallback.java

@Override
public boolean onActionItemClicked(ActionMode actionMode, MenuItem menuItem) {
    try {/*from   ww  w .j a  v  a  2s  .  c  om*/
        boolean ban = false;
        switch (menuItem.getItemId()) {
        //                case R.id.context_send_message:
        //                    if(mChatTargetProvider.getChatTarget() != null &&
        //                            mChatTargetProvider.getChatTarget().getUser() != null &&
        //                            mChatTargetProvider.getChatTarget().getUser().equals(mUser)) {
        //                        mChatTargetProvider.setChatTarget(null);
        //                    } else {
        //                        mChatTargetProvider.setChatTarget(new ChatTargetProvider.ChatTarget(mUser));
        //                    }
        //                    break;
        case R.id.context_ban:
            ban = true;
        case R.id.context_kick:
            AlertDialog.Builder alertBuilder = new AlertDialog.Builder(mContext);
            alertBuilder.setTitle(R.string.user_menu_kick);
            final EditText reasonField = new EditText(mContext);
            reasonField.setHint(R.string.hint_reason);
            alertBuilder.setView(reasonField);
            final boolean finalBan = ban;
            alertBuilder.setPositiveButton(R.string.user_menu_kick, new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    try {
                        mService.kickBanUser(mUser.getSession(), reasonField.getText().toString(), finalBan);
                    } catch (RemoteException e) {
                        e.printStackTrace();
                    }
                }
            });
            alertBuilder.setNegativeButton(android.R.string.cancel, null);
            alertBuilder.show();
            break;
        case R.id.context_mute:
            mService.setMuteDeafState(mUser.getSession(), !(mUser.isMuted() || mUser.isSuppressed()),
                    mUser.isDeafened());
            break;
        case R.id.context_deafen:
            mService.setMuteDeafState(mUser.getSession(), mUser.isMuted(), !mUser.isDeafened());
            break;
        case R.id.context_move:
            showChannelMoveDialog();
            break;
        case R.id.context_priority:
            mService.setPrioritySpeaker(mUser.getSession(), !mUser.isPrioritySpeaker());
            break;
        case R.id.context_local_mute:
            mUser.setLocalMuted(!mUser.isLocalMuted());
            mListener.onLocalUserStateUpdated(mUser);
            break;
        case R.id.context_ignore_messages:
            mUser.setLocalIgnored(!mUser.isLocalIgnored());
            mListener.onLocalUserStateUpdated(mUser);
            break;
        case R.id.context_change_comment:
            showUserComment(true);
            break;
        case R.id.context_view_comment:
            showUserComment(false);
            break;
        case R.id.context_reset_comment:
            new AlertDialog.Builder(mContext)
                    .setMessage(mContext.getString(R.string.confirm_reset_comment, mUser.getName()))
                    .setPositiveButton(R.string.confirm, new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                            try {
                                mService.setUserComment(mUser.getSession(), "");
                            } catch (RemoteException e) {
                                e.printStackTrace();
                            }
                        }
                    }).setNegativeButton(android.R.string.cancel, null).show();
            break;
        //                case R.id.context_info:
        //                    break;
        case R.id.context_register:
            mService.registerUser(mUser.getSession());
            break;
        }
    } catch (RemoteException e) {
        e.printStackTrace();
        return false;
    }
    actionMode.finish(); // FIXME?
    return true;
}

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

public boolean setValuesToDefault() {

    StoryData storyData;//  w  w  w  .ja va2 s .  co  m
    try {
        storyData = resolver.getStoryDataViaRowID(getUniqueKey());
    } catch (RemoteException e) {
        Log.d(LOG_TAG, "" + e.getMessage());
        e.printStackTrace();
        return false;
    }

    if (storyData != null) {
        Log.d(LOG_TAG, "setValuesToDefualt :" + storyData.toString());
        // set the EditTexts to the current values
        titleET.setText(String.valueOf(storyData.title).toString());
        bodyET.setText(String.valueOf(storyData.body).toString());
        audioLinkET.setText("file:///" + String.valueOf(storyData.audioLink).toString());
        videoLinkET.setText(String.valueOf(storyData.videoLink).toString());
        imageNameET.setText(String.valueOf(storyData.imageName).toString());
        imageMetaDataET.setText(String.valueOf(storyData.imageLink).toString());
        tagsET.setText(String.valueOf(storyData.tags).toString());
        storyTimeET.setText(StoryData.FORMAT.format(storyData.storyTime));
        latitudeET.setText(Double.valueOf(storyData.latitude).toString());
        longitudeET.setText(Double.valueOf(storyData.longitude).toString());
        return true;
    }
    return false;
}

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

/**
 * Call the PBS to play the entire playlist and start with the selected track.
 * A previous playlist will be cleared.//w  w  w  .j a v a  2s  . c  o  m
 *
 * @param position the position of the selected track in the adapter
 */
private void playPlaylist(int position) {

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

        // add the playlist
        mServiceConnection.getPBS().enqueuePlaylist(mPlaylistID);

        // jump to selected track
        mServiceConnection.getPBS().jumpTo(position);
    } catch (RemoteException e1) {
        // TODO Auto-generated catch block
        e1.printStackTrace();
    }
}

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

@Override
public void onServiceBound(IJumbleService service) {
    try {//w w w .j a  v a2  s  .c o  m
        if (mChannelListAdapter == null) {
            setupChannelList();
        } else {
            mChannelListAdapter.setService(service);
        }
    } catch (RemoteException e) {
        e.printStackTrace();
    }
}

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

/**
 * Call the PBS to enqueue the complete album.
 *///from  ww  w .  j  a v  a2  s .c  om
private void enqueueAlbum() {
    // Enqueue complete album

    try {
        mServiceConnection.getPBS().enqueueAlbum(mAlbumKey);
    } catch (RemoteException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

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

/**
 * Call the PBS to enqueue the selected track.
 *
 * @param position the position of the selected track in the adapter
 * @param asNext   flag if the track should be enqueued as next
 *///from  w ww .  j  a v a 2 s  .c o  m
private void enqueueTrack(int position, boolean asNext) {

    TrackModel track = (TrackModel) mAdapter.getItem(position);

    try {
        mServiceConnection.getPBS().enqueueTrack(track, asNext);
    } catch (RemoteException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

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

/**
 * Call the PBS to play the complete album and starts with the selected track.
 * A previous playlist will be cleared./*  w  ww. j a v  a2s  . c  o  m*/
 *
 * @param position the position of the selected track in the adapter
 */
private void playAlbum(int position) {
    // clear playlist and play current album

    try {
        mServiceConnection.getPBS().clearPlaylist();
        enqueueAlbum();
        mServiceConnection.getPBS().jumpTo(position);
    } catch (RemoteException e1) {
        // TODO Auto-generated catch block
        e1.printStackTrace();
    }
}

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

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    // Get the EditTexts
    loginIdET = (EditText) getView().findViewById(R.id.tags_create_value_login_id);
    storyIdET = (EditText) getView().findViewById(R.id.tags_create_value_story_id);
    tagET = (EditText) getView().findViewById(R.id.tags_create_value_tag);

    buttonClear = (Button) getView().findViewById(R.id.tags_create_button_reset);
    buttonCancel = (Button) getView().findViewById(R.id.tags_create_button_cancel);
    buttonCreate = (Button) getView().findViewById(R.id.tags_create_button_save);

    buttonClear.setOnClickListener(new OnClickListener() {
        @Override//from  w w w .  j a v  a 2  s .  co m
        public void onClick(View v) {
            loginIdET.setText("" + 0);
            storyIdET.setText("" + 0);
            tagET.setText("" + "");
        }
    });

    buttonCancel.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            if (getResources().getBoolean(R.bool.isTablet) == true) {
                // put
                mOpener.openViewTagsFragment(0);
            } else {
                getActivity().finish(); // same as hitting 'back' button
            }
        }
    });

    buttonCreate.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            // local Editables
            Editable loginIdCreateable = loginIdET.getText();
            Editable storyIdCreateable = storyIdET.getText();
            Editable tagCreateable = tagET.getText();

            long loginId = 0;
            long storyId = 0;
            String tag = "";

            // pull values from Editables
            loginId = Long.valueOf(loginIdCreateable.toString());
            storyId = Long.valueOf(storyIdCreateable.toString());
            tag = String.valueOf(tagCreateable.toString());

            // new TagsData object with above info
            TagsData newData = new TagsData(-1,
                    // -1 row index, because there is no way to know which row it
                    // will go into
                    loginId, storyId, tag);

            // insert it through Resolver to be put into ContentProvider
            try {
                resolver.insert(newData);
            } catch (RemoteException e) {
                Log.e(LOG_TAG, "Caught RemoteException => " + e.getMessage());
                e.printStackTrace();
            }
            // return back to proper state
            if (getResources().getBoolean(R.bool.isTablet) == true) {
                // put
                mOpener.openViewTagsFragment(0);
            } else {
                getActivity().finish(); // same as hitting 'back' button
            }
        }
    });

}

From source file:com.ucmap.dingdinghelper.services.TimingService.java

private void notifyUpdateUi(String time) {
    if (mITimerListenerRemoteCallbackList == null)
        return;//  ww  w.  jav  a  2s . c o  m
    int number = mITimerListenerRemoteCallbackList.beginBroadcast();

    for (int i = 0; i < number; i++) {

        ITimerListener mITimerListener = mITimerListenerRemoteCallbackList.getBroadcastItem(i);
        if (mITimerListener == null)
            continue;
        try {
            mITimerListener.toCallback(time);
        } catch (RemoteException e) {
            e.printStackTrace();
        }
    }
    mITimerListenerRemoteCallbackList.finishBroadcast();
}

From source file:fr.mixit.android.ui.fragments.MyPlanningFragment.java

protected void getStarredSessions(int memberId) {
    if (mIsBound && mServiceReady) {
        final Message msg = Message.obtain(null, MixItService.MSG_GET_STARRED_SESSION, 0, 0);
        msg.replyTo = mMessenger;//from w w w.  j  av  a  2  s. co  m
        final Bundle b = new Bundle();
        b.putInt(MixItService.EXTRA_MEMBER_ID, memberId);
        msg.setData(b);
        try {
            mService.send(msg);
            setRefreshMode(true);
        } catch (final RemoteException e) {
            e.printStackTrace();
        }
    }
}