small fix
This commit is contained in:
parent
7f33ffd9a1
commit
229fee9669
@ -71,7 +71,7 @@ public class CalculatorActivity extends Activity implements FontSizeAdjuster, Sh
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.main);
|
setContentView(R.layout.main);
|
||||||
|
|
||||||
firstTimeInit();
|
firstTimeInit(preferences);
|
||||||
|
|
||||||
calculatorView = CalculatorView.instance.init(this, preferences, CalculatorModel.instance);
|
calculatorView = CalculatorView.instance.init(this, preferences, CalculatorModel.instance);
|
||||||
|
|
||||||
@ -154,10 +154,10 @@ public class CalculatorActivity extends Activity implements FontSizeAdjuster, Sh
|
|||||||
setTheme(styleId);
|
setTheme(styleId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized void firstTimeInit() {
|
private synchronized void firstTimeInit(@NotNull SharedPreferences preferences) {
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
try {
|
try {
|
||||||
CalculatorModel.instance.init(this, PreferenceManager.getDefaultSharedPreferences(this));
|
CalculatorModel.instance.init(this, preferences);
|
||||||
} catch (EvalError evalError) {
|
} catch (EvalError evalError) {
|
||||||
throw new RuntimeException("Could not initialize interpreter!");
|
throw new RuntimeException("Could not initialize interpreter!");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user