安卓输入错误 [英] Input Error in android
问题描述
我在 android 中开发了一个应用程序.它的输入字段工作正常,例如在 2.2、2.3 中输入用户名和密码(这将调用服务并获得 xml 响应),但在 4.0、4.1 中不起作用.
I developed an application in android. Its input fields are working fine e.g. username and password inputs (this will call the services and get a xml response) in 2.2, 2.3 but it does not work in 4.0, 4.1.
xml
EditText
android:id="@+id/email"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="4"
android:imeOptions="actionNext"
android:singleLine="true"
android:text=""
在错误日志中.
Url is not found
(在捕获异常中..)
编辑
android 4.1 sdk 和更新的 eclipse log cat 正在打印大量
android 4.1 sdk and updated eclipse log cat was printing lot
07-03 11:57:07.826: I/Choreographer(2747): Skipped 44 frames!
The application may be doing too much work on its main thread.
因此,我无法在 Log cat 上轻松找到错误.
by that I can't easily find error on Log cat.
错误是:
07-03 11:58:25.927: E/ActivityThread(555): Failed to find provider info
for com.android.inputmethod.latin.dictionarypack 07-03 11:58:25.947:
E/BinaryDictionaryGetter(555): Could not find a dictionary pack
推荐答案
如果它在 android 2.2 & 上运行良好2.3 操作系统,那么错误可能是由于 android 4.0 中更严格的网络策略.在您的活动/通信类中添加以下静态块将消除 4.0 中与通信策略相关的问题
if it is working fine on android 2.2 & 2.3 OSs, then the error may be due to the more strict network policies in android 4.0. Adding the below static block in your activity/communication-class will remove the communication policy related issues in 4.0
static{
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
}
这篇关于安卓输入错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!