【发布时间】:2021-01-05 10:31:17
【问题描述】:
val callIntent = Intent(this, AcsActivity::class.java)
//callIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
callIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS)
startActivity(callIntent)
finish()
点击此代码后,屏幕变黑,如果我在最近的应用中看到此应用,它会显示正确的 UI。
调用的活动:
class AcsActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_acs)
}
}
调用的活动界面
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="org.jio.meet.conference.view.activity.AcsActivity">
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
调用的活动清单条目:
<activity android:name="org.jio.meet.conference.view.activity.AcsActivity"
android:configChanges="keyboardHidden|orientation|screenSize"/>
调用活动清单条目:
<activity
android:name="org.jio.meet.dashboard.view.activity.StartMeetingActivity"
android:configChanges="locale|orientation|screenSize"
android:label=""
android:launchMode="singleTop"
android:theme="@style/AppTheme" />
不知道这里出了什么问题,请您帮忙吗?
【问题讨论】:
标签: android android-intent android-activity