mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-20 15:34:26 +08:00
refactor: Application modules to classes
This commit is contained in:
@ -1,10 +1,13 @@
|
||||
import * as common from './application-settings-common';
|
||||
import { getNativeApplication } from '../application';
|
||||
import { Application } from '../application';
|
||||
|
||||
let sharedPreferences: android.content.SharedPreferences;
|
||||
function ensureSharedPreferences() {
|
||||
if (!sharedPreferences) {
|
||||
sharedPreferences = (<android.app.Application>getNativeApplication()).getApplicationContext().getSharedPreferences('prefs.db', 0);
|
||||
sharedPreferences = Application.android
|
||||
.getNativeApplication()
|
||||
.getApplicationContext()
|
||||
.getSharedPreferences('prefs.db', 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user