Adds application class.

This commit is contained in:
2021-04-30 23:41:38 -07:00
parent d0c40992f1
commit 10c601f5da
2 changed files with 45 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
package com.majinnaibu.monstercards;
import android.app.Application;
import android.content.Context;
import android.content.res.Configuration;
import androidx.room.Room;
import com.majinnaibu.monstercards.data.MonsterRepository;
public class MonsterCardsApplication extends Application {
public static MonsterCardsApplication getInstance(Context context) {
return (MonsterCardsApplication) context.getApplicationContext();
}
public MonsterCardsApplication() {
}
// Called when the application is starting, before any other application objects have been created.
// Overriding this method is totally optional!
@Override
public void onCreate() {
super.onCreate();
// Required initialization logic here!
}
// Called by the system when the device configuration changes while your component is running.
// Overriding this method is totally optional!
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
}
// This is called when the overall system is running low on memory,
// and would like actively running processes to tighten their belts.
// Overriding this method is totally optional!
@Override
public void onLowMemory() {
super.onLowMemory();
}
}