@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); setRetainInstance(true); setHasOptionsMenu(true); pd = new ProgressDialog(getSherlockActivity()); pd.setMessage(getResources().getString(R.string.locating_user_text)); mModel = (QuestionModel) getArguments().getSerializable(QUESTION_MODEL_EXTRA); pd.show(); locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, this); }
@Override public void onFailure(final Throwable throwable) { super.onFailure(throwable); getSherlockActivity() .runOnUiThread( new Runnable() { @Override public void run() { pd.dismiss(); displayError( getResources().getString(R.string.error_msg_title), throwable.getMessage(), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { dialogInterface.dismiss(); } }); } }); }
@Override public void onPause() { super.onPause(); busController.getBus().unregister(this); }
@Override public void onResume() { super.onResume(); busController.getBus().register(this); }
@Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { super.onCreateOptionsMenu(menu, inflater); inflater.inflate(R.menu.answer_menu, menu); }