我有以下布局(几乎为空):
<?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并且错误仍然存在,我必须做一些根本错误的基本错误导致这种情况.
有没有人对如何在没有错误的情况下加载它有任何想法?
我使用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}.如果我要将数字放在其位置,这将工作正常,但我需要此值来自加载的属性文件.
任何帮助深表感谢.