List of usage examples for android.os RemoteException printStackTrace
public void printStackTrace()
From source file:fr.mixit.android.ui.fragments.MembersListFragment.java
protected void refreshMembersData() { if (mIsBound && mServiceReady) { setRefreshMode(true);/* ww w. j ava 2 s.c om*/ final Message msg = Message.obtain(null, MixItService.MSG_MEMBERS, 0, 0); msg.replyTo = mMessenger; final Bundle b = new Bundle(); msg.setData(b); try { mService.send(msg); } catch (final RemoteException e) { e.printStackTrace(); } mIsFirstLoad = false; } else { setRefreshMode(false); } }
From source file:org.deviceconnect.android.deviceplugin.host.setting.HostSettingFragment.java
/** * Host PluginSearch???.//from w w w.j a va2s .co m */ public void searchHost() { showProgressDialog(); try { mService.searchHost(); } catch (RemoteException e) { if (BuildConfig.DEBUG) { e.printStackTrace(); } } // Handler?? MyHandler handler = new MyHandler(); Message mMsg = new Message(); mMsg.what = HANDLER_ACTION_DISMISS; handler.sendMessageDelayed(mMsg, 8000); }
From source file:org.yammp.app.MusicBrowserActivity.java
@Override public boolean onOptionsItemSelected(MenuItem item) { Intent intent;/*from w w w . j ava 2s.c om*/ switch (item.getItemId()) { case PLAY_PAUSE: if (mService == null) return false; try { mService.togglePause(); } catch (RemoteException e) { e.printStackTrace(); } break; case NEXT: if (mService == null) return false; try { mService.next(); } catch (RemoteException e) { e.printStackTrace(); } break; case GOTO_PLAYBACK: intent = new Intent(INTENT_PLAYBACK_VIEWER); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); break; case SHUFFLE_ALL: MusicUtils.shuffleAll(getApplicationContext()); break; case SETTINGS: intent = new Intent(INTENT_MUSIC_SETTINGS); startActivity(intent); break; } return super.onOptionsItemSelected(item); }
From source file:me.ziccard.secureit.fragment.AccelerometerFragment.java
public void onSensorChanged(SensorEvent event) { long curTime = System.currentTimeMillis(); // only allow one update every 100ms. if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) { if ((curTime - lastUpdate) > 100) { long diffTime = (curTime - lastUpdate); lastUpdate = curTime;/*from w w w .j av a 2 s.c o m*/ accel_values = event.values.clone(); if (alert && remainingAlertPeriod > 0) { remainingAlertPeriod = remainingAlertPeriod - 1; } else { accelerometerText.setVisibility(View.INVISIBLE); alert = false; } view.renderer.setPosition(-accel_values[0], accel_values[1], accel_values[2]); if (last_accel_values != null) { float speed = Math.abs(accel_values[0] + accel_values[1] + accel_values[2] - last_accel_values[0] + last_accel_values[1] + last_accel_values[2]) / diffTime * 10000; if (speed > SHAKE_THRESHOLD) { /* * Send Alert */ alert = true; remainingAlertPeriod = maxAlertPeriod; accelerometerText.setVisibility(View.VISIBLE); Message message = new Message(); message.what = UploadService.ACCELEROMETER_MESSAGE; try { if (serviceMessenger != null) { serviceMessenger.send(message); } } catch (RemoteException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } last_accel_values = accel_values.clone(); } } }
From source file:cx.ring.client.AccountEditionActivity.java
private void processAccount() { try {/*w ww . j av a 2 s .co m*/ service.getRemoteService().setCredentials(acc_selected.getAccountID(), acc_selected.getCredentialsHashMapList()); Map<String, String> details = acc_selected.getDetails(); service.getRemoteService().setAccountDetails(acc_selected.getAccountID(), details); Log.w(TAG, "service.setAccountDetails " + details.get("Account.hostname")); getSupportActionBar().setTitle(acc_selected.getAlias()); ; } catch (RemoteException e) { e.printStackTrace(); } }
From source file:com.granita.tasks.notification.NotificationActionIntentService.java
private void markCompleted(Uri taskUri) { ContentResolver contentResolver = getContentResolver(); ArrayList<ContentProviderOperation> operations = new ArrayList<ContentProviderOperation>(1); ContentProviderOperation.Builder operation = ContentProviderOperation.newUpdate(taskUri); operation.withValue(Tasks.STATUS, Tasks.STATUS_COMPLETED); operations.add(operation.build());/* w ww . j av a 2s . c o m*/ try { contentResolver.applyBatch(mAuthority, operations); } catch (RemoteException e) { Log.e(TAG, "Remote exception during complete task action"); e.printStackTrace(); } catch (OperationApplicationException e) { Log.e(TAG, "Unable to mark task completed: " + taskUri); e.printStackTrace(); } }
From source file:my.home.lehome.service.SendMsgIntentService.java
private void preparePengindCommand(Intent intent) { Messenger messenger;/*from ww w . j a v a 2 s. c om*/ if (intent.hasExtra("messenger")) messenger = (Messenger) intent.getExtras().get("messenger"); else messenger = null; Message repMsg = Message.obtain(); repMsg.what = MSG_BEGIN_SENDING; boolean isSysCmd = intent.getBooleanExtra("isSysCmd", false); if (isSysCmd) { Log.d(TAG, "sys cmd item"); return; } ChatItem item = intent.getParcelableExtra("update"); if (item == null) { item = new ChatItem(); item.setContent(intent.getStringExtra("cmd")); item.setType(ChatItemConstants.TYPE_CLIENT); item.setState(Constants.CHATITEM_STATE_ERROR); // set ERROR item.setDate(new Date()); DBStaticManager.addChatItem(getApplicationContext(), item); } item.setState(Constants.CHATITEM_STATE_PENDING); Log.d(TAG, "enqueue item: \n" + item); Bundle bundle = new Bundle(); bundle.putBoolean("update", intent.hasExtra("update")); bundle.putParcelable("item", item); if (messenger != null) { repMsg.setData(bundle); try { messenger.send(repMsg); } catch (RemoteException e) { e.printStackTrace(); } } else { Log.d(TAG, "messager is null, send broadcast instead:" + ACTION_SEND_MSG_BEGIN); Intent newIntent = new Intent(ACTION_SEND_MSG_BEGIN); newIntent.putExtras(bundle); sendBroadcast(newIntent); } intent.putExtra("pass_item", item); }
From source file:org.egov.android.controller.ServiceController.java
/** * After binding the service, we can send message to the service to start/stop running * background jobs.//from w w w . j av a2s . c o m * * @param action * => START, STOP * @param b * => bundle data to be send */ public void sendMessageToService(int action, Bundle b) { if (isBound && myService != null) { try { Message msg = Message.obtain(null, action); msg.setData(b); myService.send(msg); } catch (RemoteException e) { e.printStackTrace(); } } }
From source file:com.google.android.apps.gutenberg.provider.SyncAdapter.java
private void syncCheckins(ContentProviderClient provider, String cookie) { Cursor cursor = null;//from w ww. j a v a 2 s . co m try { cursor = provider.query(Table.ATTENDEE.getBaseUri(), new String[] { Table.Attendee.ID, Table.Attendee.CHECKIN, Table.Attendee.EVENT_ID, }, Table.Attendee.CHECKIN_MODIFIED, null, null); if (0 == cursor.getCount()) { Log.d(TAG, "No checkin to sync."); return; } int syncCount = 0; while (cursor.moveToNext()) { String attendeeId = cursor.getString(cursor.getColumnIndexOrThrow(Table.Attendee.ID)); String eventId = cursor.getString(cursor.getColumnIndexOrThrow(Table.Attendee.EVENT_ID)); long checkin = cursor.getLong(cursor.getColumnIndexOrThrow(Table.Attendee.CHECKIN)); long serverCheckin = postCheckIn(attendeeId, eventId, checkin == 0, cookie); if (serverCheckin >= 0) { ContentValues values = new ContentValues(); values.put(Table.Attendee.CHECKIN_MODIFIED, false); if (0 == serverCheckin) { values.putNull(Table.Attendee.CHECKIN); } else { values.put(Table.Attendee.CHECKIN, serverCheckin); } provider.update(Table.ATTENDEE.getItemUri(eventId, attendeeId), values, null, null); ++syncCount; } } Log.d(TAG, syncCount + " checkin(s) synced."); } catch (RemoteException e) { e.printStackTrace(); } finally { if (cursor != null) { cursor.close(); } } }
From source file:org.gateshipone.odyssey.fragments.ArtistsFragment.java
/** * Call the PBS to play the selected artist. * A previous playlist will be cleared./*from w ww.j ava 2s.c om*/ * * @param position the position of the selected artist in the adapter */ private void playArtist(int position) { // Remove old tracks try { mServiceConnection.getPBS().clearPlaylist(); } catch (RemoteException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } // get and enqueue all albums of the current artist enqueueArtist(position); // play album try { mServiceConnection.getPBS().jumpTo(0); } catch (RemoteException e) { // TODO Auto-generated catch block e.printStackTrace(); } }