List of usage examples for android.os RemoteException getMessage
public String getMessage()
From source file:edu.vuum.mocca.ui.tags.EditTagsFragment.java
public boolean setValuesToDefault() { TagsData tagsData;//from w w w .ja v a 2 s .c om try { tagsData = resolver.getTagsDataViaRowID(getUniqueKey()); } catch (RemoteException e) { Log.d(LOG_TAG, "" + e.getMessage()); e.printStackTrace(); return false; } if (tagsData != null) { Log.d(LOG_TAG, "setValuesToDefualt :" + tagsData.toString()); // set the EditTexts to the current values loginIdET.setText(Long.valueOf(tagsData.loginId).toString()); storyIdET.setText(Long.valueOf(tagsData.storyId).toString()); tagET.setText(String.valueOf(tagsData.tag).toString()); return true; } return false; }
From source file:com.kevelbreh.steamchat.activity.AuthenticationActivity.java
/** * Authenticate the user. Perform actions depending on the required form state and result code * of the Steam API./*w ww . j av a 2 s . c o m*/ */ @OnClick(R.id.authenticate) public void authenticate() { if (isValid()) try { Bundle data = new Bundle(); data.putString("username", getUsername()); data.putString("password", getPassword()); data.putString("guard", getGuard()); data.putString("machine", getMachine()); Message message = Message.obtain(null, SteamService.EVENT_STEAM_USER_LOGIN); message.setData(data); mService.send(message); } catch (RemoteException e) { SteamChat.debug(this, e.getMessage(), e); } }
From source file:com.mylovemhz.simplay.MediaControlFragment.java
@Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); if (savedInstanceState != null) { token = savedInstanceState.getParcelable(STATE_TOKEN); previousDrawable = savedInstanceState.getInt(STATE_PREVIOUS); pauseDrawableResource = savedInstanceState.getInt(STATE_PAUSE); playDrawableResource = savedInstanceState.getInt(STATE_PLAY); nextDrawable = savedInstanceState.getInt(STATE_NEXT); }// w ww .java2 s . c o m albumImage = (ImageView) view.findViewById(R.id.albumImage); artistText = (TextView) view.findViewById(R.id.artistText); nextButton = (ImageButton) view.findViewById(R.id.nextButton); playPauseButton = (ImageButton) view.findViewById(R.id.playPauseButton); previousButton = (ImageButton) view.findViewById(R.id.previousButton); seekBar = (SeekBar) view.findViewById(R.id.seekBar); titleText = (TextView) view.findViewById(R.id.titleText); try { mediaController = new MediaControllerCompat(getContext(), token); mediaController.registerCallback(mediaControllerCallback); } catch (RemoteException e) { Log.e(TAG, e.getMessage()); } initViews(); }
From source file:edu.vuum.mocca.ui.tags.TagsViewFragment.java
private void deleteButtonPressed() { String message;/*from w ww . j a v a 2 s . co m*/ message = getResources().getString(R.string.tags_view_deletion_dialog_message); new AlertDialog.Builder(getActivity()).setIcon(android.R.drawable.ic_dialog_alert) .setTitle(R.string.tags_view_deletion_dialog_title).setMessage(message) .setPositiveButton(R.string.tags_view_deletion_dialog_yes, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { try { resolver.deleteAllTagsWithRowID(tagsData.KEY_ID); } catch (RemoteException e) { Log.e(LOG_TAG, "RemoteException Caught => " + e.getMessage()); e.printStackTrace(); } mOpener.openListTagsFragment(); if (getResources().getBoolean(R.bool.isTablet) == true) { mOpener.openViewTagsFragment(-1); } else { getActivity().finish(); } } }).setNegativeButton(R.string.tags_view_deletion_dialog_no, null).show(); }
From source file:com.ariesmcrae.mymemories.ui.story.EditStoryFragment.java
public boolean setValuesToDefault() { StoryData storyData;/*from ww w. ja va2 s. c o 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: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 av a 2 s . c o 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.ubimobitech.spotifystreamer.PlaybackFragment.java
/** * Called when a view has been clicked.//from ww w . j av a2 s. c o m * * @param v The view that was clicked. */ @Override public void onClick(View v) { switch (v.getId()) { case R.id.play_pause: try { if (mService.getState() != LocalPlayback.STATE_PLAYING) { mService.play(mTrackInfo.get(mCurrentPosition), mCurrentPosition); updateHandler.postDelayed(new ProgressUpdater(), 100); mPlayPause.setImageResource(R.drawable.ic_pause_circle_filled_black_48dp); } else { mService.pause(); } } catch (RemoteException e) { Log.e(TAG, e.getMessage()); } break; case R.id.next: try { if ((mCurrentPosition + 1) < mTrackInfo.size()) { mCurrentPosition += 1; mService.next(); updateHandler.postDelayed(new ProgressUpdater(), 100); mPlayPause.setImageResource(R.drawable.ic_pause_circle_filled_black_48dp); updatePlaybackScreen(mCurrentPosition); } } catch (RemoteException e) { Log.e(TAG, e.getMessage()); } break; case R.id.previous: try { if ((mCurrentPosition - 1) >= 0) { mCurrentPosition -= 1; mService.prev(); updateHandler.postDelayed(new ProgressUpdater(), 100); mPlayPause.setImageResource(R.drawable.ic_pause_circle_filled_black_48dp); updatePlaybackScreen(mCurrentPosition); } } catch (RemoteException e) { Log.e(TAG, e.getMessage()); } break; } }
From source file:com.ariesmcrae.mymemories.ui.story.StoryViewFragment.java
private void deleteButtonPressed() { String message;//from w ww . jav a2s . co m message = getResources().getString(R.string.story_view_deletion_dialog_message); new AlertDialog.Builder(getActivity()).setIcon(android.R.drawable.ic_dialog_alert) .setTitle(R.string.story_view_deletion_dialog_title).setMessage(message) .setPositiveButton(R.string.story_view_deletion_dialog_yes, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { try { resolver.deleteAllStoryWithRowID(storyData.KEY_ID); } catch (RemoteException e) { Log.e(LOG_TAG, "RemoteException Caught => " + e.getMessage()); e.printStackTrace(); } mOpener.openListStoryFragment(); if (getResources().getBoolean(R.bool.isTablet) == true) { mOpener.openViewStoryFragment(-1); } else { getActivity().finish(); } } }).setNegativeButton(R.string.story_view_deletion_dialog_no, null).show(); }
From source file:com.nokia.example.pepperfarm.iap.Payment.java
public boolean consumeProduct(String productId, String token) { if (!isBillingAvailable()) return false; boolean consumed = false; try {/*w w w . ja v a 2 s .co m*/ Log.i("consumeProduct", "Consuming product: " + productId + " PurchaseToken: " + token); int response = npay.consumePurchase(API_VERSION, activity.getPackageName(), productId, token); if (response == RESULT_OK) consumed = true; } catch (RemoteException e) { Log.e("isBillingAvailable", e.getMessage(), e); } return consumed; }
From source file:org.onepf.oms.appstore.SamsungAppsBillingService.java
private void initIap() { int errorCode = IabHelper.BILLING_RESPONSE_RESULT_ERROR; String errorMsg = "Init IAP service failed"; try {/*from w ww .j a v a 2s . c om*/ Bundle result = mIapConnector.init(CURRENT_MODE); if (result != null) { int statusCode = result.getInt(KEY_NAME_STATUS_CODE); if (isDebugLog()) Log.d(TAG, "Init IAP connection status code: " + statusCode); errorMsg = result.getString(KEY_NAME_ERROR_STRING); if (statusCode == IAP_ERROR_NONE) { errorCode = IabHelper.BILLING_RESPONSE_RESULT_OK; } } } catch (RemoteException e) { Log.e(TAG, "Init IAP: " + e.getMessage()); } setupListener.onIabSetupFinished(new IabResult(errorCode, errorMsg)); }