android.os.RemoteException.toString()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(3.7k)|赞(0)|评价(0)|浏览(134)

本文整理了Java中android.os.RemoteException.toString方法的一些代码示例,展示了RemoteException.toString的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RemoteException.toString方法的具体详情如下:
包路径:android.os.RemoteException
类名称:RemoteException
方法名:toString

RemoteException.toString介绍

暂无

代码示例

代码示例来源:origin: magicsih/AndroidScreenCaster

@Override
public void onServiceConnected(ComponentName name, IBinder service) {
  Log.i(TAG, name + " service is connected.");
  serviceMessenger = new Messenger(service);
  Message msg = Message.obtain(null, ActivityServiceMessage.CONNECTED);
  msg.replyTo = messenger;
  try {
    serviceMessenger.send(msg);
  } catch (RemoteException e) {
    Log.e(TAG,"Failed to send message due to:" + e.toString());
    e.printStackTrace();
  }
}

代码示例来源:origin: magicsih/AndroidScreenCaster

private void stopScreenCapture() {
    if (serviceMessenger == null) {
      return;
    }
//        final Intent stopCastIntent = new Intent(ScreenCastService.ACTION_STOP_CAST);
//        sendBroadcast(stopCastIntent);

    Message msg = Message.obtain(null, ActivityServiceMessage.STOP);
    msg.replyTo = messenger;
    try {
      serviceMessenger.send(msg);
    } catch (RemoteException e) {
      Log.e(TAG, "RemoteException:" + e.toString());
      e.printStackTrace();
    }
  }
}

代码示例来源:origin: JonesChi/CastScreen

@Override
public void onServiceConnected(ComponentName name, IBinder service) {
  Log.d(TAG, "Service connected, name: " + name);
  mServiceMessenger = new Messenger(service);
  try {
    Message msg = Message.obtain(null, Common.MSG_REGISTER_CLIENT);
    msg.replyTo = mMessenger;
    mServiceMessenger.send(msg);
    Log.d(TAG, "Connected to service, send register client back");
  } catch (RemoteException e) {
    Log.d(TAG, "Failed to send message back to service, e: " + e.toString());
    e.printStackTrace();
  }
}

代码示例来源:origin: magicsih/AndroidScreenCaster

private void unbindService() {
  if (serviceMessenger != null) {
    try {
      Message msg = Message.obtain(null, ActivityServiceMessage.DISCONNECTED);
      msg.replyTo = messenger;
      serviceMessenger.send(msg);
    } catch (RemoteException e) {
      Log.d(TAG, "Failed to send unregister message to service, e: " + e.toString());
      e.printStackTrace();
    }
    unbindService(serviceConnection);
  }
}

代码示例来源:origin: JonesChi/CastScreen

private void doUnbindService() {
  if (mServiceMessenger != null) {
    try {
      Message msg = Message.obtain(null, Common.MSG_UNREGISTER_CLIENT);
      msg.replyTo = mMessenger;
      mServiceMessenger.send(msg);
    } catch (RemoteException e) {
      Log.d(TAG, "Failed to send unregister message to service, e: " + e.toString());
      e.printStackTrace();
    }
    unbindService(mServiceConnection);
  }
}

代码示例来源:origin: googlesamples/android-MediaBrowserService

@Override
  public void onConnected() {
    try {
      // Get a MediaController for the MediaSession.
      mMediaController =
          new MediaControllerCompat(mContext, mMediaBrowser.getSessionToken());
      mMediaController.registerCallback(mMediaControllerCallback);
      // Sync existing MediaSession state to the UI.
      mMediaControllerCallback.onMetadataChanged(mMediaController.getMetadata());
      mMediaControllerCallback.onPlaybackStateChanged(
          mMediaController.getPlaybackState());
      MediaBrowserHelper.this.onConnected(mMediaController);
    } catch (RemoteException e) {
      Log.d(TAG, String.format("onConnected: Problem: %s", e.toString()));
      throw new RuntimeException(e);
    }
    mMediaBrowser.subscribe(mMediaBrowser.getRoot(), mMediaBrowserSubscriptionCallback);
  }
}

代码示例来源:origin: openbmap/radiocells-scanner-android

final ContentProviderResult[] results = contentResolver.applyBatch("org.openbmap.provider", operations);
} catch (final RemoteException e) {
  Log.e(TAG, e.toString(), e);
} catch (final OperationApplicationException e) {
  Log.e(TAG, e.toString(), e);

代码示例来源:origin: openbmap/radiocells-scanner-android

final ContentProviderResult[] results = contentResolver.applyBatch("org.openbmap.provider", operations);
} catch (final RemoteException e) {
  Log.e(TAG, e.toString(), e);
} catch (final OperationApplicationException e) {
  Log.e(TAG, e.toString(), e);

相关文章