@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 protected void onPostExecute(Venue venue) { try { if (VenueUtils.isValid(venue)) { setVenue(venue); } else { NotificationsUtil.ToastReasonForFailure(VenueActivity.this, mReason); finish(); } } finally { stopProgressBar(PROGRESS_BAR_TASK_ID); } }