diff options
Diffstat (limited to 'app/src/main/java/org/pacien/tincapp/context/App.kt')
-rw-r--r-- | app/src/main/java/org/pacien/tincapp/context/App.kt | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/app/src/main/java/org/pacien/tincapp/context/App.kt b/app/src/main/java/org/pacien/tincapp/context/App.kt new file mode 100644 index 0000000..4b7e44e --- /dev/null +++ b/app/src/main/java/org/pacien/tincapp/context/App.kt | |||
@@ -0,0 +1,22 @@ | |||
1 | package org.pacien.tincapp.context | ||
2 | |||
3 | import android.app.Application | ||
4 | import android.content.Context | ||
5 | |||
6 | /** | ||
7 | * @author pacien | ||
8 | */ | ||
9 | class App : Application() { | ||
10 | |||
11 | override fun onCreate() { | ||
12 | super.onCreate() | ||
13 | appContext = applicationContext | ||
14 | } | ||
15 | |||
16 | companion object { | ||
17 | private var appContext: Context? = null | ||
18 | fun getContext() = appContext!! | ||
19 | fun getResources() = getContext().resources!! | ||
20 | } | ||
21 | |||
22 | } | ||