java - 为什么我的应用程序在多次单击 Textview/Views 时会像进入后台模式一样关闭?
问题描述
我有一个TextView
或Button
当我点击任何View
或TextView
android 应用程序时像进入后台模式一样关闭。为什么会发生这种情况我不知道。请帮我摆脱这个错误。这是我的xml代码:
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/default_margin"
android:layout_marginRight="@dimen/default_margin"
android:visibility="visible"
android:background="@drawable/text_cta"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_all"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_5"
android:layout_marginRight="@dimen/margin_5"
android:textAlignment="center"
android:gravity="center"
android:fontFamily="@font/sf_regular"
android:text="Next"
android:textColor="@color/colorOrange"
android:textSize="@dimen/text_20" />
</LinearLayout>
这是我的点击操作:
@OnClick({R.id.ll_profile, R.id.tv_all})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.ll_profile:
//callProfileAPI();
startActivity(new Intent(context, ProfileActivity.class).putExtra("isFrom", ""));
break;
case R.id.tv_all:
startActivity(new Intent(context, ViewAllClubNewsActivity.class).putExtra("isFrom", "Home"));
break;
}
}
我真的很烦这个错误,我没有找到任何答案。我尝试在我的视图中添加以下行:
android:splitMotionEvents="false"
但我没有工作。
以下是每次出现的堆栈跟踪 :06-09 12:06:49.403 7048-8137/com.bocawestcc.cobaltmemberapp E/FA:无法使用远程或本地测量实施。请在应用清单中注册 AppMeasurementService 服务
请帮我...
解决方案
推荐阅读
- wordpress - 当您复制一个部分并隐藏一个用于移动设备和一个用于桌面时,使锚点起作用
- python - 如何删除列表中的前 50 个项目而不复制它?
- javascript - 尝试使用增益节点增加视频音量,而是静音
- php - 为用户身份验证生成“令牌”的最佳方法是什么
- vue.js - 是否可以将 vite 与 Nuxt.js 一起使用以快速重新加载?
- javascript - 将 puppeteer 视口设置为 null 不会更改视口
- python - 尝试将列表中的所有项目打印到行和列
- r - 从cutree组R的祖先节点获取树
- pandas - 更改 seaborn 直方图(或 plt)中数据选择的条形颜色
- angular - 如何在常规 Angular 组件和 Angular Element 之间共享代码?