package com.renrenliao.im.base


import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity


/**
 *Author:ganZhe
 *时间:2020/10/21 7:30 PM
 *描述:This is BaseActivity
 */
abstract class BaseActivity:AppCompatActivity() {



    override fun onCreate(savedInstanceState: Bundle?) {

        super.onCreate(savedInstanceState)
        setContentView(getLayoutResId())
        initActivity()
    }

    protected open fun initActivity() {
        initView()
        initData()
    }

//    override fun attachBaseContext(newBase: Context) {
//        //获取我们存储的语言环境 比如 "en","zh","hi",等等
//      //  val language: String = LanguageUtil.getDefaultLanguage()
//
//  //      super.attachBaseContext(LanguageUtil.attachBaseContext(newBase,language))
//
//    }

    /*override fun onResume() {
        super.onResume()
        val language: String = LanguageUtil.getDefaultLanguage()
        LanguageUtil.updateResources(this, language)
    }*/

    abstract fun getLayoutResId(): Int
    abstract fun initView()
    abstract fun initData()


}