我在 android 中开发了一个应用程序。它的输入字段工作正常,例如在 2.2、2.3 中输入用户名和密码(这将调用服务并获得 xml 响应),但在 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 正在打印很多
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 上找到错误。
错误是:
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 中更严格的网络策略。在您的 Activity/通信类中添加以下静态 block 将消除 4.0 中与通信策略相关的问题
static{
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
}
关于android - 安卓输入错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11305388/