<commit_before>package fr.free.nrw.commons.theme;

import android.content.Intent;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;

import fr.free.nrw.commons.R;

public class BaseAppCompatActivity extends AppCompatActivity {
    boolean currentTheme;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("theme",false)) {
            currentTheme = true;g
            setTheme(R.style.DarkAppTheme);
        }else {
            currentTheme = false;
            setTheme(R.style.LightAppTheme); //default
        }
        super.onCreate(savedInstanceState);
    }

    @Override
    protected void onResume() {
        //Restart activity if theme is changed
        Log.d("deneme","onResume Base");
        boolean newTheme = PreferenceManager.getDefaultSharedPreferences(this).getBoolean("theme",false);
        if(currentTheme!=newTheme){ //is activity theme changed
            Intent intent = getIntent();
            finish();
            startActivity(intent);
        }<commit_msg>Fix my cats press on keyboard<commit_after>package fr.free.nrw.commons.theme;

import android.content.Intent;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;

import fr.free.nrw.commons.R;

public class BaseAppCompatActivity extends AppCompatActivity {
    boolean currentTheme;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("theme",false)) {
            currentTheme = true;
            setTheme(R.style.DarkAppTheme);
        }else {
            currentTheme = false;
            setTheme(R.style.LightAppTheme); //default
        }
        super.onCreate(savedInstanceState);
    }

    @Override
    protected void onResume() {
        //Restart activity if theme is changed
        Log.d("deneme","onResume Base");
        boolean newTheme = PreferenceManager.getDefaultSharedPreferences(this).getBoolean("theme",false);
        if(currentTheme!=newTheme){ //is activity theme changed
            Intent intent = getIntent();
            finish();
            startActivity(intent);
        }
{'fraction_non_alphanumeric': 0.09768421052631579, 'fraction_numerical': 0.0008421052631578948, 'mean_word_length': 3.0, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '3873630', 'n_tokens_mistral': 615, 'n_tokens_neox': 611, 'n_words': 129}