Source:
<code>public void onNavigationDrawerItemSelected(int position) { if (position == 1) { Intent intent = new Intent(this, ConversationActivity.class); if(ApplozicClient.getInstance(this).isContextBasedChat()){ intent.putExtra(ConversationUIService.CONTEXT_BASED_CHAT,true); } startActivity(intent); return; } if (position == 0) { mTitle = getString(R.string.ecommerce); FragmentManager fragmentManager = getSupportFragmentManager(); fragmentManager.beginTransaction() .replace(R.id.container, EcommerceFragment.newInstance("", "")) .commit(); return; } if (position == 2) { UserLogoutTask.TaskListener userLogoutTaskListener = new UserLogoutTask.TaskListener(){ @Override public void onSuccess(Context context) { userLogoutTask = null; Toast.makeText(getBaseContext(), "Log out successful", Toast.LENGTH_SHORT).show(); <START> new UserClientService(context).logout(); <END> Intent intent = new Intent(context, LoginActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP); startActivity(intent); } @Override public void onFailure(Exception exception) { userLogoutTask = null; AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this).create(); alertDialog.setTitle(getString(R.string.text_alert)); alertDialog.setMessage(exception.toString()); alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, getString(android.R.string.ok), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); if (!isFinishing()) { alertDialog.show(); } } }; userLogoutTask = new UserLogoutTask(userLogoutTaskListener,this); userLogoutTask.execute((Void)null); finish(); return; } FragmentManager fragmentManager = getSupportFragmentManager(); fragmentManager.beginTransaction() .replace(R.id.container, PlaceholderFragment.newInstance(position + 1)) .commit(); }</code><technical_language>@amiteshP remove new UserClientService(context).logout(); is called UserLogoutTask.java</technical_language>

Target:
public void onNavigationDrawerItemSelected(int position) { if (position == 1) { Intent intent = new Intent(this, ConversationActivity.class); if(ApplozicClient.getInstance(this).isContextBasedChat()){ intent.putExtra(ConversationUIService.CONTEXT_BASED_CHAT,true); } startActivity(intent); return; } if (position == 0) { mTitle = getString(R.string.ecommerce); FragmentManager fragmentManager = getSupportFragmentManager(); fragmentManager.beginTransaction() .replace(R.id.container, EcommerceFragment.newInstance("", "")) .commit(); return; } if (position == 2) { UserLogoutTask.TaskListener userLogoutTaskListener = new UserLogoutTask.TaskListener(){ @Override public void onSuccess(Context context) { userLogoutTask = null; Toast.makeText(getBaseContext(), "Log out successful", Toast.LENGTH_SHORT).show(); Intent intent = new Intent(context, LoginActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP); startActivity(intent); } @Override public void onFailure(Exception exception) { userLogoutTask = null; AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this).create(); alertDialog.setTitle(getString(R.string.text_alert)); alertDialog.setMessage(exception.toString()); alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, getString(android.R.string.ok), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); if (!isFinishing()) { alertDialog.show(); } } }; userLogoutTask = new UserLogoutTask(userLogoutTaskListener,this); userLogoutTask.execute((Void)null); finish(); return; } FragmentManager fragmentManager = getSupportFragmentManager(); fragmentManager.beginTransaction() .replace(R.id.container, PlaceholderFragment.newInstance(position + 1)) .commit(); }