Code example for Fragment

Methods: getActivity, startActivity

0
	 
	@Override 
	public boolean onOptionsItemSelected(MenuItem item) {
		switch(item.getItemId()) {
			case android.R.id.home:
				Intent intent = new Intent(getActivity(), MenuActivity.class);
				intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
				startActivity(intent);
				return true; 
			default: 
				return super.onOptionsItemSelected(item);
		} 
	} 
	 
    /* 
     * Callback for fetching current user's name, picture, uid. 
     */ 
    public class OrderDrinkPostListener extends BaseRequestListener { 
 
        public void onComplete(final String response, final Object state) {
        	dialog.dismiss();