Commit 13124cb9 authored by wanglei's avatar wanglei

...

parent 574d1f45
......@@ -52,14 +52,16 @@ class MyApplication : BaseApplication() {
}
}
fun initApp() {
fun initApp(isFirst:Boolean=false) {
if (!isFirst){
val topic = ConfigHelper.packageName + "_push"
FCMManager.initFirebase(this)
FCMManager.subscribeToTopic(topic)
LogEx.logDebug(TAG, "topic=${topic}")
ScreenStatusReceiver.setupScreenStatusListener(this)
InstallHelps.init()
}
if (ifAgreePrivacy) {
AdmobMaxHelper.initAdmobMaxAd()
MainScope().launch(Dispatchers.Main) {
......
......@@ -32,8 +32,10 @@ import com.base.datarecovery.help.BaseActivity
import com.base.datarecovery.help.KotlinExt.toFormatSize
import com.base.datarecovery.utils.BarUtils
import com.base.datarecovery.utils.AppPreferences
import com.base.datarecovery.utils.LogEx
class ResultActivity : BaseActivity<ActivityLayoutResultBinding>() {
private val TAG = "ResultActivity"
override val binding: ActivityLayoutResultBinding by lazy {
ActivityLayoutResultBinding.inflate(layoutInflater)
......@@ -93,11 +95,11 @@ class ResultActivity : BaseActivity<ActivityLayoutResultBinding>() {
adapter.updateListPosition()
adapter.notifyDataSetChanged()
val from = intent.getStringExtra("from")
val from = intent.extras?.getString("from")
LogEx.logDebug(TAG, "from=$from")
when (from) {
JUNK_CLEANER -> {
if (intent.getLongExtra("clean_size", 0L) > 0) {
val size = intent.getLongExtra("clean_size", 0L).toFormatSize(1)
binding.tvInfo.text = "Cleaned up $size"
} else {
......@@ -132,7 +134,7 @@ class ResultActivity : BaseActivity<ActivityLayoutResultBinding>() {
binding.ivBack.setOnClickListener {
onBackPressedDispatcher.onBackPressed()
}
AdmobMaxHelper.admobMaxShowNativeAd(this@ResultActivity,binding.flAd)
AdmobMaxHelper.admobMaxShowNativeAd(this@ResultActivity, binding.flAd)
}
override fun onDestroy() {
......
......@@ -204,7 +204,7 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() {
}
oneClickStart = true
ifAgreePrivacy = true
(application as MyApplication).initApp()
(application as MyApplication).initApp(true)
AdmobMaxHelper.preloadAd(this)
binding.llStart.visibility = View.GONE
binding.llProgress.visibility = View.VISIBLE
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment