Android - SPAN_EXCLUSIVE_EXCLUSIVE 跨度不能为零长度 [英] Android - SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

查看:33
本文介绍了Android - SPAN_EXCLUSIVE_EXCLUSIVE 跨度不能为零长度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下布局(几乎是空的):

I have the following layout (virtually empty):

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/set_layout"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:contentDescription="content desc"
    android:orientation="vertical" >

    <TextView android:id="@+id/text"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Hello, I am a TextView" />
</LinearLayout>

Activity 类包含以下内容:

The Activity class contains the following:

public class TestActivity extends Activity {
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_test);   
  }
}

当我在移动设备上运行此程序时,出现以下错误:

When I run this on my mobile device I get the following error:

SpannableStringBuilder
SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

我在使用和不使用 TextView 的情况下都尝试过,但错误仍然存​​在,对于导致这种情况的基本布局,我必须做一些根本性的错误.

I have tried this with and without the TextView and the error still remains, I must be doing something fundamentally wrong for such a basic layout to cause this.

有没有人知道如何在没有错误的情况下加载它?

Does anyone have any ideas on how I can get this to load without the error?

推荐答案

我在 LogCat 中遇到了相同的错误条目.就我而言,它是由我使用的第 3 方键盘引起的.当我将其改回 Android 键盘时,错误条目不再显示.

I have run into the same error entries in LogCat. In my case it's caused by the 3rd party keyboard I am using. When I change it back to Android keyboard, the error entry does not show up any more.

这篇关于Android - SPAN_EXCLUSIVE_EXCLUSIVE 跨度不能为零长度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆