关闭时启动器活动与对话框显示apk图标不正常视图

时间:2017-12-25 03:50:42

标签: android android-dialog

  

启动器活动

<activity
    android:name=".module.lanuch.LaunchActivity"
    android:configChanges="locale|layoutDirection"
    android:screenOrientation="portrait">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

运行对话框

mDialog = MaterialDialog.Builder(this).customView(R.layout.layout_update, false).canceledOnTouchOutside(false)
        .show()
mDialog!!.window.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
mDialog!!.setOnDismissListener { onBackPressed() }

mContent = mDialog!!.findViewById(R.id.content) as TextView
mContent!!.movementMethod = ScrollingMovementMethod()
mLastVersion = mDialog!!.findViewById(R.id.version) as TextView
mUpdate = mDialog!!.findViewById(R.id.download_install) as ShadowButton
mProgress = mDialog!!.findViewById(R.id.down_progress) as ProgressBar
mClose = mDialog!!.findViewById(R.id.update_close) as Button
mClose!!.setOnClickListener {
    if(mDialog!!.isShowing) {
        mDialog!!.dismiss()
        normalFlow(rightnow)
    }
}

当关闭对话框应用程序显示带有apk图标的框架然后处理正常流程时,它很难看,我不喜欢这个框架。谁能解释为什么会发生这种情况?

1 个答案:

答案 0 :(得分:0)

更改此代码

  mClose!!.setOnClickListener {
    if(mDialog!!.isShowing) {
        mDialog!!.dismiss()
        normalFlow(rightnow)
    }
  }

    mClose!!.setOnClickListener {
        if(mDialog!!.isShowing) {
            mDialog!!.dismiss()
        }
    }
    mDialog!!.setOnDismissListener {
          normalFlow(rightnow)
    }