You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
800 B
38 lines
800 B
package net.pokeranalytics.android.util
|
|
|
|
import android.os.Bundle
|
|
import android.os.PersistableBundle
|
|
import android.view.MenuItem
|
|
import androidx.appcompat.app.AppCompatActivity
|
|
import io.realm.Realm
|
|
|
|
open class PokerAnalyticsActivity : AppCompatActivity() {
|
|
|
|
private val realm = Realm.getDefaultInstance()
|
|
|
|
override fun onCreate(savedInstanceState: Bundle?, persistentState: PersistableBundle?) {
|
|
super.onCreate(savedInstanceState, persistentState)
|
|
}
|
|
|
|
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
|
|
item?.let {
|
|
if (it.itemId == android.R.id.home) {
|
|
finish()
|
|
}
|
|
}
|
|
return super.onOptionsItemSelected(item)
|
|
}
|
|
|
|
override fun onDestroy() {
|
|
super.onDestroy()
|
|
realm.close()
|
|
}
|
|
|
|
/**
|
|
* Return the realm instance
|
|
*/
|
|
fun getRealm(): Realm {
|
|
return realm
|
|
}
|
|
|
|
} |