首页 > 解决方案 > 为什么我的应用程序在多次单击 Textview/Views 时会像进入后台模式一样关闭?

问题描述

我有一个TextViewButton当我点击任何ViewTextViewandroid 应用程序时像进入后台模式一样关闭。为什么会发生这种情况我不知道。请帮我摆脱这个错误。这是我的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 服务

请帮我...

标签: javaandroid

解决方案


推荐阅读