protected void setupShortcut(Venue venue) { // First, set up the shortcut intent. For this example, we simply create // an intent that // will bring us directly back to this activity. A more typical // implementation would use a // data Uri in order to display a more specific result, or a custom // action in order to // launch a specific operation. Intent shortcutIntent = new Intent(Intent.ACTION_MAIN); shortcutIntent.setClassName(this, VenueActivity.class.getName()); shortcutIntent.putExtra(Foursquared.EXTRA_VENUE_ID, venue.getId()); // Then, set up the container intent (the response to the caller) Intent intent = new Intent(); intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent); intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, venue.getName()); Parcelable iconResource = Intent.ShortcutIconResource.fromContext(this, R.drawable.venue_shortcut_icon); intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, iconResource); // Now, return the result to the launcher setResult(RESULT_OK, intent); }
private void onVenueSet() { Venue venue = mStateHolder.venue; if (DEBUG) Log.d(TAG, "onVenueSet:" + venue.getName()); setTitle(venue.getName() + " - Foursquare"); mVenueView.setVenue(venue); mVenueView.setCheckinButtonEnabled(mStateHolder.venueId != null); }
void startItemActivity(Venue venue) { Intent intent = new Intent(SearchVenuesActivity.this, VenueActivity.class); intent.setAction(Intent.ACTION_VIEW); intent.putExtra(Foursquared.EXTRA_VENUE_ID, venue.getId()); startActivity(intent); }
private void setVenue(Venue venue) { mStateHolder.venue = venue; mStateHolder.venueId = venue.getId(); venueObservable.notifyObservers(venue); onVenueSet(); }