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); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); setContentView(R.layout.venue_activity); registerReceiver(mLoggedOutReceiver, new IntentFilter(Foursquared.INTENT_ACTION_LOGGED_OUT)); initTabHost(); StateHolder holder = (StateHolder) getLastNonConfigurationInstance(); mVenueView = (VenueView) findViewById(R.id.venue); mVenueView.setCheckinButtonOnClickListener( new OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(VenueActivity.this, ShoutActivity.class); ShoutActivity.venueIntoIntentExtras(mStateHolder.venue, intent); startActivityForResult(intent, RESULT_SHOUT); } }); if (holder != null && VenueUtils.isValid(holder.venue)) { if (DEBUG) Log.d(TAG, "Restoring Venue: " + holder.venue); setVenue(holder.venue); } else { new VenueTask().execute(getIntent().getExtras().getString(Foursquared.EXTRA_VENUE_ID)); } }
@Override public void onActivityResult(int requestCode, int resultCode, Intent data) { if (resultCode == Activity.RESULT_OK) { mCheckedInSuccessfully = true; mVenueView.setCheckinButtonEnabled(false); } }