小编DMa*_*Mac的帖子

Android - SPAN_EXCLUSIVE_EXCLUSIVE跨度不能为零长度

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

<?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>
Run Code Online (Sandbox Code Playgroud)

Activity类包含以下内容:

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

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

SpannableStringBuilder
SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
Run Code Online (Sandbox Code Playgroud)

我已经尝试过使用和不使用TextView并且错误仍然存​​在,我必须做一些根本错误的基本错误导致这种情况.

有没有人对如何在没有错误的情况下加载它有任何想法?

java android

182
推荐指数
5
解决办法
19万
查看次数

Spring 3如何使用属性文件的间隔运行计划任务

我使用Spring 3创建一个计划任务.

我必须使用基于XML的布线来配置它,并希望计划任务以在属性文件中设置的间隔运行.

Spring Context文件:

<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.springframework.org/schema/beans
                       http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
                       http://www.springframework.org/schema/context
                       http://www.springframework.org/schema/context/spring-context-3.1.xsd
                       http://www.springframework.org/schema/task
                       http://www.springframework.org/schema/task/spring-task-3.1.xsd"
   xmlns:context="http://www.springframework.org/schema/context"
   xmlns:task="http://www.springframework.org/schema/task">

  <context:property-placeholder location="classpath:connector.properties"/>

  <task:scheduler id="connectorScheduler" pool-size="10"/>

  <task:scheduled-tasks scheduler="connectorScheduler">
    <task:scheduled ref="connector" method="checkConnection" fixed-rate="${connector.connectionAttemptDelayMillis}"/>
  </task:scheduled-tasks>


  <bean id="connector" class="com.test.Connector" scope="singleton">
    <constructor-arg index="0" value="${connector.user}"/>
    <constructor-arg index="1" value="${connector.password}"/>
    <constructor-arg index="2" value="${connector.connectionAttemptDelayMillis}"/>
  </bean>

</beans>
Run Code Online (Sandbox Code Playgroud)

问题是固定速率值中不允许$ {connector.connectionAttemptDelayMillis}.如果我要将数字放在其位置,这将工作正常,但我需要此值来自加载的属性文件.

任何帮助深表感谢.

java spring

3
推荐指数
1
解决办法
7591
查看次数

标签 统计

java ×2

android ×1

spring ×1