@Override public void onClick(View view) { try { binding.download(TO_DOWNLOAD); } catch (RemoteException e) { Log.e(getClass().getSimpleName(), "Exception requesting download", e); Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_LONG).show(); } }
@Override public void renameAccount(int userId, IAccountManagerResponse response, Account accountToRename, String newName) { if (accountToRename == null) throw new IllegalArgumentException("account is null"); Account resultingAccount = renameAccountInternal(userId, accountToRename, newName); Bundle result = new Bundle(); result.putString(AccountManager.KEY_ACCOUNT_NAME, resultingAccount.name); result.putString(AccountManager.KEY_ACCOUNT_TYPE, resultingAccount.type); try { response.onResult(result); } catch (RemoteException e) { Log.w(TAG, e.getMessage()); } }
@Override public void onClick(View view) { try { binding.download(TO_DOWNLOAD); } catch (RemoteException e) { Log.e(getClass().getSimpleName(), "Exception requesting download", e); Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_LONG).show(); } }
@Override public void onClick(View view) { try { binding.download(TO_DOWNLOAD, cb); } catch (RemoteException e) { Log.e(getClass().getSimpleName(), "Exception requesting download", e); Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_LONG).show(); } }
protected void listVPNs() { try { List<APIVpnProfile> list = mService.getProfiles(); String all="List:"; for(APIVpnProfile vp:list.subList(0, Math.min(5, list.size()))) { all = all + vp.mName + ":" + vp.mUUID + "\n"; } if (list.size() > 5) all +="\n And some profiles...."; if(list.size()> 0) { Button b= mStartVpn; b.setOnClickListener(this); b.setVisibility(View.VISIBLE); b.setText(list.get(0).mName); mStartUUID = list.get(0).mUUID; } mHelloWorld.setText(all); } catch (RemoteException e) { // TODO Auto-generated catch block mHelloWorld.setText(e.getMessage()); } }
public void onSlow(boolean restart) { if (callback != null) { try { callback.onSlow(restart); } catch (RemoteException e) { Log.e(LOG_TAG, "Faile to notify decoder slow, error: " + e.getMessage()); } } }
@Override public void send(final Intent message) { try { callback.sendMessage(message); } catch (RemoteException e) { mLogger.warning("Failed to send message to Device Connect Manager: message = " + e.getMessage()); } } });
public void onDecodeHardwareFrame(long pts) { if (callback != null) { try { callback.onDecodeHardwareFrame(pts); } catch (RemoteException e) { Log.e(LOG_TAG, "Faile to notify hardware decode event, error: " + e.getMessage()); } } }
public void onError(int code) { if (callback != null) { try { callback.onError(code); } catch (RemoteException e) { Log.e(LOG_TAG, "Faile to notify error code: " + code + ", error: " + e.getMessage()); } } }
@Override public void renameAccount(int userId, IAccountManagerResponse response, Account accountToRename, String newName) { if (accountToRename == null) throw new IllegalArgumentException("account is null"); Account resultingAccount = renameAccountInternal(userId, accountToRename, newName); Bundle result = new Bundle(); result.putString(AccountManager.KEY_ACCOUNT_NAME, resultingAccount.name); result.putString(AccountManager.KEY_ACCOUNT_TYPE, resultingAccount.type); try { response.onResult(result); } catch (RemoteException e) { Log.w(TAG, e.getMessage()); } }
@Override public void renameAccount(int userId, IAccountManagerResponse response, Account accountToRename, String newName) { if (accountToRename == null) throw new IllegalArgumentException("account is null"); Account resultingAccount = renameAccountInternal(userId, accountToRename, newName); Bundle result = new Bundle(); result.putString(AccountManager.KEY_ACCOUNT_NAME, resultingAccount.name); result.putString(AccountManager.KEY_ACCOUNT_TYPE, resultingAccount.type); try { response.onResult(result); } catch (RemoteException e) { Log.w(TAG, e.getMessage()); } }
public void onServiceConnected(ComponentName className, IBinder binderService) { widgetRefreshIconService = new Messenger(binderService); widgetRotationServiceLock.lock(); try { while (!unsentMessages.isEmpty()) { widgetRefreshIconService.send(unsentMessages.poll()); } } catch (RemoteException e) { appendLog(context, TAG, e.getMessage(), e); } finally { widgetRotationServiceLock.unlock(); } } public void onServiceDisconnected(ComponentName className) {
private Bundle getPurchasesBundle(IInAppBillingService service, String itemType, String continueToken) throws BillingException { try { return service.getPurchases(mApiVersion, mPackageName, itemType, continueToken); } catch (RemoteException e) { throw new BillingException(Constants.ERROR_REMOTE_EXCEPTION, e.getMessage()); } }
public void onServiceConnected(ComponentName className, IBinder binderService) { currentWeatherService = new Messenger(binderService); currentWeatherServiceLock.lock(); try { while (!currentWeatherUnsentMessages.isEmpty()) { currentWeatherService.send(currentWeatherUnsentMessages.poll()); } } catch (RemoteException e) { appendLog(getBaseContext(), TAG, e.getMessage(), e); } finally { currentWeatherServiceLock.unlock(); } } public void onServiceDisconnected(ComponentName className) {
public void onServiceConnected(ComponentName className, IBinder binderService) { weatherForecastService = new Messenger(binderService); weatherForecastServiceLock.lock(); try { while (!weatherForecastUnsentMessages.isEmpty()) { weatherForecastService.send(weatherForecastUnsentMessages.poll()); } } catch (RemoteException e) { appendLog(getBaseContext(), TAG, e.getMessage(), e); } finally { weatherForecastServiceLock.unlock(); } } public void onServiceDisconnected(ComponentName className) {
public void onServiceConnected(ComponentName className, IBinder binderService) { weatherForecastService = new Messenger(binderService); weatherForecastServiceLock.lock(); try { while (!weatherForecastUnsentMessages.isEmpty()) { weatherForecastService.send(weatherForecastUnsentMessages.poll()); } } catch (RemoteException e) { appendLog(getBaseContext(), TAG, e.getMessage(), e); } finally { weatherForecastServiceLock.unlock(); } } public void onServiceDisconnected(ComponentName className) {
public void onServiceConnected(ComponentName name, IBinder boundService) { service = IPlaybackService.Stub.asInterface(boundService); try { state = service.getState(); } catch (RemoteException e) { Logger.e(LOGNAME, "Unable to access state:" + e.getMessage()); } updateUi(); }
TextTranslationResult translate(String key, String category, String fromCode, String toCode, List<String> texts) { if (iTranslatorApi == null) { return new TextTranslationResult(Translator.ERROR_NOT_BOUND, "not bound!"); } try { return new TextTranslationResult(iTranslatorApi.translateTextArray(key, category, fromCode, toCode, texts)); } catch (RemoteException ex) { return new TextTranslationResult(Translator.ERROR_OTHER, ex.getMessage()); } }
LanguageListResult getTextLanguages() { if (iTranslatorApi == null) { return new LanguageListResult(Translator.ERROR_NOT_BOUND, "not bound!"); } try { return new LanguageListResult(iTranslatorApi.getTextLanguages()); } catch (RemoteException ex) { return new LanguageListResult(Translator.ERROR_OTHER, ex.getMessage()); } }
private void pauseTask(DownloadInfo info) { if (serviceStarted) { try { Logger.d("暂停" + info.getChapter_name() + "的下载"); binder.pauseTask(info); } catch (RemoteException e) { Logger.e(e.getMessage()); } } }