Bimba.git

ref: dd2ee96d47a98c46ac7ca5a5631e01b8b40a4bea

app/src/main/java/ml/adamsprogs/bimba/SplashActivity.kt


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
package ml.adamsprogs.bimba

import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.content.Intent
import ml.adamsprogs.bimba.models.Timetable


class SplashActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        if(Timetable(this).isDatabaseHealthy())
            startActivity(Intent(this, MainActivity::class.java))
        else
            startActivity(Intent(this, NoDbActivity::class.java))
        finish()
    }
}