<commit_before>/*
 * This project is licensed under the open source MPL V2.
 * See https://github.com/openMF/android-client/blob/master/LICENSE.md
 */

package com.mifos.mifosxdroid.online;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;

import com.mifos.mifosxdroid.SplashScreenActivity;
import com.mifos.objects.User;

/**
 * Logout activity.
 */
public class LogoutActivity extends ActionBarActivity {
    public final static String TAG = LogoutActivity.class.getSimpleName();
    public static final String NA = "NA";

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        logout(this);
    }

    public void logout(Context context) {
        Log.d(TAG, "logout");
        SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
        SharedPreferences.Editor editor = sharedPreferences.edit();
        editor.putString(User.AUTHENTICATION_KEY, NA);
        editor.commit();
        editor.apply();
        startActivity(new Intent(LogoutActivity.this, SplashScreenActivity.class));
    }
}
<commit_msg>Fixed logout, url reinitialized<commit_after>/*
 * This project is licensed under the open source MPL V2.
 * See https://github.com/openMF/android-client/blob/master/LICENSE.md
 */

package com.mifos.mifosxdroid.online;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;

import com.mifos.mifosxdroid.R;
import com.mifos.mifosxdroid.SplashScreenActivity;
import com.mifos.objects.User;
import com.mifos.utils.Constants;

/**
 * Logout activity.
 */
public class LogoutActivity extends ActionBarActivity {
    public final static String TAG = LogoutActivity.class.getSimpleName();
    public static final String NA = "NA";

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        logout(this);
    }

    public void logout(Context context) {
        Log.d(TAG, "logout");
        SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
        SharedPreferences.Editor editor = sharedPreferences.edit();
        editor.putString(User.AUTHENTICATION_KEY, NA);
        editor.putString(Constants.INSTANCE_URL_KEY, getString(R.string.default_instance_url));
        editor.commit();
        editor.apply();
        startActivity(new Intent(LogoutActivity.this, SplashScreenActivity.class));
    }
}

{'fraction_non_alphanumeric': 0.09978693181818182, 'fraction_numerical': 0.0014204545454545455, 'mean_word_length': 4.15934065934066, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6080984', 'n_tokens_mistral': 805, 'n_tokens_neox': 788, 'n_words': 165}