Skip to content

Instantly share code, notes, and snippets.

@engr-erum
Created November 13, 2017 05:13
Show Gist options
  • Save engr-erum/a92e6787c295e13e7c00662e749f9eab to your computer and use it in GitHub Desktop.
Save engr-erum/a92e6787c295e13e7c00662e749f9eab to your computer and use it in GitHub Desktop.
have made activityA for login
activityB that contains tablayout and with 3 fragments.
on 3rd tab fragment ----- there is button for logout.
Clicking on logout will clear local storage and move user to activityA for login.
Right now i used this code
private void doLogout() {
if(getActivity() != null && getContext() != null)
{
SalesforceSDKManager.getInstance().logout(getActivity());
SharedPreferencesManager.getSharedPreferenceInstance(getContext()).setBoolean(getString(R.string.str_login), false);
Intent intent = new Intent(getActivity(), LoginActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);
getActivity().finish();
}
}
but the issue is its not changing activityA for login .... this code is changing selection of tab3 to tab1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment