android.os.RemoteException#printStackTrace ( )源码实例Demo

下面列出了android.os.RemoteException#printStackTrace ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: odyssey   文件: CurrentPlaylistView.java
/**
 * Set the PBSServiceConnection object.
 * This will create a new Adapter.
 */
public void registerPBServiceConnection(PlaybackServiceConnection playbackServiceConnection) {
    if(playbackServiceConnection == null) {
        return;
    }
    mPlaybackServiceConnection = playbackServiceConnection;

    mCurrentPlaylistAdapter = new CurrentPlaylistAdapter(mContext, mPlaybackServiceConnection);
    mCurrentPlaylistAdapter.hideArtwork(mHideArtwork);

    mListView.setAdapter(mCurrentPlaylistAdapter);
    mListView.setOnScrollListener(new ScrollSpeedListener(mCurrentPlaylistAdapter));

    // set the selection to the current track, so the list view will positioned appropriately
    try {
        mListView.setSelection(mPlaybackServiceConnection.getPBS().getCurrentIndex());
    } catch (RemoteException e) {
        e.printStackTrace();
    }
}
 
源代码2 项目: K-Sonic   文件: ServiceBackedMediaPlayer.java
/**
 * Functions identically to android.media.MediaPlayer.isPlaying()
 * @return True if the track is playing
 */
@Override
public boolean isPlaying() {
	if (pmInterface == null) {
		if (!ConnectPlayMediaService()) {
			ServiceBackedMediaPlayer.this.error(MediaPlayer.MEDIA_ERROR_UNKNOWN, 0);
		}
	}
	if (pmInterface != null) {
		try {
			return pmInterface.isPlaying(ServiceBackedMediaPlayer.this.sessionId);
		} catch (RemoteException e) {
			e.printStackTrace();
			ServiceBackedMediaPlayer.this.error(MediaPlayer.MEDIA_ERROR_UNKNOWN, 0);
		}
	}
	return false;
}
 
源代码3 项目: AutoInputAuthCode   文件: ReadSmsService.java
/**
 * 发送消息到注册界面
 *
 * @param msgWhat
 * @param msgObj
 */
private void sendMsg2Register(int msgWhat, String msgObj) {
    if (mMessenger != null) {
        Message msg = Message.obtain();
        msg.what = msgWhat;
        msg.obj = msgObj;

        try {
            mMessenger.send(msg);
        } catch (RemoteException e) {
            e.printStackTrace();
        } finally {
            stopSelf();
        }
    }
}
 
源代码4 项目: Study_Android_Demo   文件: MainActivity.java
public void send(View view){

        //通过Messenger发消息
        Message msgToService = Message.obtain();
        msgToService.what=200;

        //带上参数
//        msgToService.obj = "自古真情留不住";         不行,要序列化
        Bundle bundle = new Bundle();
        bundle.putString("key","自古真情留不住");
        msgToService.setData(bundle);

        //Message有个变量,指定谁来接收返回的消息
        msgToService.replyTo = messengerClient;
        try {
            messengerService.send(msgToService);
        } catch (RemoteException e) {
            e.printStackTrace();
        }


    }
 
源代码5 项目: Musicoco   文件: SongOption.java
private void handleShowMore() {
    if (mDialog.visible()) {
        mDialog.hide();
    } else {
        Song s = null;
        try {
            s = control.currentSong();
        } catch (RemoteException e) {
            e.printStackTrace();
        }
        SongInfo info = mediaManager.getSongInfo(activity, s);
        String title = activity.getString(R.string.song) + ": " + info.getTitle();
        mDialog.setTitle(title);
        mDialog.show();
    }
}
 
源代码6 项目: apollo-DuerOS   文件: BtHfpManager.java
public boolean answerCallNative() {
    boolean ret = false;
    if (mBinder != null) {
        try {
            if (mBinder.acceptCall()) {
                LogUtil.d(TAG, "Accept call in success");
                ret = true;
            } else {
                LogUtil.d(TAG, "Accept call in failure");
                ret = false;
            }
        } catch (RemoteException e) {
            e.printStackTrace();
        }
    }

    return ret;
}
 
源代码7 项目: yiim_v2   文件: CallActivity.java
@Override
public void onClick(View v) {
	try {
		if (v == mCloseCall) {
			getXmppBinder().closeCall();
			stopRingtone();
			CallActivity.call_state = UA_STATE_IDLE;
			finish();
		} else if (v == mAcceptCall) {
			getXmppBinder().acceptCall();
			stopRingtone();
			CallActivity.call_state = UA_STATE_INCALL;
			mAcceptCall.setVisibility(View.GONE);
		}
	} catch (RemoteException e) {
		e.printStackTrace();
	}
}
 
源代码8 项目: hk   文件: ApkInstrumenterActivity.java
/**
 * Ask InstrumentationService to send its configuration.
 */
public void askForConfiguration() {
	if (!mBound) {
		Log.i(TAG, "mBound is null, sendEvent failed");
		return;
	}

	Message msg = Message.obtain(null, InstrumentationService.GetConfiguration);
	msg.replyTo = mMessenger;
	try {
		Log.i(TAG, "Asking configuration if instrumentation service");
		mService.send(msg);
	} catch (RemoteException e) {
		e.printStackTrace();
	}

}
 
源代码9 项目: K-Sonic   文件: ServiceBackedMediaPlayer.java
/**
 * Functions identically to android.media.MediaPlayer.isLooping()
 * @return True if the track is looping
 */
@Override
public boolean isLooping() {
	Log.d(SBMP_TAG, "isLooping() 382");
	if (pmInterface == null) {
		if (!ConnectPlayMediaService()) {
			ServiceBackedMediaPlayer.this.error(MediaPlayer.MEDIA_ERROR_UNKNOWN, 0);
		}
	}
	try {
		return pmInterface.isLooping(ServiceBackedMediaPlayer.this.sessionId);
	} catch (RemoteException e) {
		e.printStackTrace();
		ServiceBackedMediaPlayer.this.error(MediaPlayer.MEDIA_ERROR_UNKNOWN, 0);
	}
	return false;
}
 
源代码10 项目: BLEService   文件: CharacteristicDetailsActivity.java
@Override
public void run() {
	try {
		mService.readRemoteRSSI(mDevice.getAddress());	
	} catch (RemoteException rex) {
		rex.printStackTrace();
	}
}
 
源代码11 项目: odyssey   文件: NowPlayingView.java
/**
 * Saves the current state as a bookmark. This just calls the PBS and asks him to save the state.
 *
 * @param bookmarkTitle Name of the bookmark to store.
 */
public void createBookmark(String bookmarkTitle) {
    // call pbs and create bookmark with the given title for the current state
    try {
        mServiceConnection.getPBS().createBookmark(bookmarkTitle);
    } catch (RemoteException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
 
源代码12 项目: ContactMerger   文件: ContactDataMapper.java
/**
 * Save a single status update.
 * @param statusUpdate The status update to be stored.
 */
public void persist(StatusUpdate statusUpdate) {
    ContentValues values = new ContentValues();
    try {
        put(values, statusUpdate);
        provider.insert(StatusUpdates.CONTENT_URI, values);
    } catch (RemoteException e) {
        e.printStackTrace();
    }
}
 
源代码13 项目: springreplugin   文件: PluginServiceServer.java
private void callConnectedMethodLocked(IServiceConnection conn, ComponentName cn, IBinder b) {
    try {
        conn.connected(cn, b);
    } catch (RemoteException e) {
        if (BuildConfig.DEBUG) {
            e.printStackTrace();
        }
    }
}
 
源代码14 项目: container   文件: VActivityManager.java
public void publishService(IBinder token, Intent intent, IBinder service) {
    try {
        getService().publishService(token, intent, service, VUserHandle.myUserId());
    } catch (RemoteException e) {
        e.printStackTrace();
    }
}
 
源代码15 项目: Musicoco   文件: BottomNavigationController.java
@Override
public void onClick(View v) {
    switch (v.getId()) {
        case R.id.list_bottom_nav_container:
            ActivityManager.getInstance().startPlayActivity(activity);
            break;
        case R.id.list_play: {
            boolean play = mPlay.isChecked();
            try {
                if (play) {
                    mControl.resume();
                } else mControl.pause();
            } catch (RemoteException e) {
                e.printStackTrace();
            }
            break;
        }
        case R.id.list_list:
            if (listViewsController.visible()) {
                listViewsController.hide();
            } else {
                listViewsController.show();
            }
            break;
        default:
            break;
    }
}
 
源代码16 项目: RePlugin-GameSdk   文件: BaseController.java
public void exit(Activity ctx,SdkExitCallBack exitCallBack){
	IBinder binder = RePlugin.fetchBinder("funcellplugin", "sdkImpl");
	if(binder == null){
		return;
	}
	IInteractiveService service = IInteractiveService.Stub.asInterface(binder);
	try {
		service.Exit(exitCallBack);
	} catch (RemoteException e) {
		e.printStackTrace();
	}
}
 
源代码17 项目: prettygoodmusicplayer   文件: NowPlaying.java
private void playPause(){
	Log.d(TAG, "Play/Pause clicked...");
	Message msg = Message.obtain(null, MusicPlaybackService.MSG_PLAYPAUSE);
	try {
		Log.i(TAG, "Sending a request to start playing!");
		mService.send(msg);
	} catch (RemoteException e) {
		e.printStackTrace();
	}
}
 
源代码18 项目: joynr   文件: BinderServiceConnection.java
public void onServiceConnected(ComponentName componentName, IBinder service) {

        logger.debug("onServiceConnected {}/{}", componentName.getPackageName(), componentName.getShortClassName());
        io.joynr.android.messaging.binder.JoynrBinder remoteServiceClient = io.joynr.android.messaging.binder.JoynrBinder.Stub.asInterface(
                service);
        try {
            remoteServiceClient.transmit(data);
        } catch (RemoteException error) {
            error.printStackTrace();
            failureAction.execute(error);
        }

        context.unbindService(this);
        successAction.execute();
    }
 
源代码19 项目: BluetoothSocket   文件: BlueManager.java
/**
 * 启动蓝牙Service 端,此方法用于Service 端
 */
public void startService(){
    if (mProxyService != null){
        try {
            mProxyService.startService();
        } catch (RemoteException e) {
            e.printStackTrace();
        }
    }
}
 
源代码20 项目: Maying   文件: Shadowsocks.java
private void updateState(boolean resetConnectionTest) {
    if (mServiceBoundContext.bgService != null) {
        try {
            int state = mServiceBoundContext.bgService.getState();
            switch (state) {
                case Constants.State.CONNECTING:
                    fab.setBackgroundTintList(greyTint);
                    serviceStarted = false;
                    fab.setImageResource(R.drawable.ic_start_busy);
                    preferences.setEnabled(false);
                    fabProgressCircle.show();
                    stat.setVisibility(View.GONE);
                    break;
                case Constants.State.CONNECTED:
                    fab.setBackgroundTintList(greenTint);
                    serviceStarted = true;
                    fab.setImageResource(R.drawable.ic_start_connected);
                    preferences.setEnabled(false);
                    fabProgressCircle.postDelayed(new Runnable() {
                        @Override
                        public void run() {
                            hideCircle();
                        }
                    }, 100);
                    stat.setVisibility(View.VISIBLE);
                    if (resetConnectionTest) {
                        if (ShadowsocksApplication.app.isNatEnabled()) {
                            connectionTestText.setVisibility(View.GONE);
                        } else {
                            connectionTestText.setVisibility(View.VISIBLE);
                            connectionTestText.setText(getString(R.string.connection_test_pending));
                        }
                    }
                    break;
                case Constants.State.STOPPING:
                    fab.setBackgroundTintList(greyTint);
                    serviceStarted = false;
                    fab.setImageResource(R.drawable.ic_start_busy);
                    preferences.setEnabled(false);
                    fabProgressCircle.show();
                    stat.setVisibility(View.GONE);
                    break;
                default:
                    fab.setBackgroundTintList(greyTint);
                    serviceStarted = false;
                    fab.setImageResource(R.drawable.ic_start_idle);
                    preferences.setEnabled(true);
                    fabProgressCircle.postDelayed(new Runnable() {
                        @Override
                        public void run() {
                            hideCircle();
                        }
                    }, 100);
                    stat.setVisibility(View.GONE);
                    break;
            }
        } catch (RemoteException e) {
            e.printStackTrace();
        }
    }
}