package com.example.myapplication;

import android.app.Application;
import android.content.SharedPreferences;
import android.widget.Toast;

import androidx.multidex.MultiDexApplication;

public class MyApplicationJava extends MyBasApplicationJava {
    SharedPreferences.OnSharedPreferenceChangeListener listener;

    @Override
    public void onCreate() {
        super.onCreate();
        setUpPrefListener();
    }
    private void setUpPrefListener() {
        listener = getListener();
        pref = MySingletonPref.getInstance(this);
        pref.setListener(listener);
    }

    private SharedPreferences.OnSharedPreferenceChangeListener getListener() {
        return (sharedPreferences, key) -> {
            Toast.makeText(this,"pref changed", Toast.LENGTH_SHORT).show();
        };
    }
}
