android - 安卓输入错误

标签 android android-layout

我在 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/

相关文章:

android - 动态生成的 LinearLayouts 重叠

android - 如何在滚动 ListView 上显示类似 Whatsapp 的日期

Android - 像表格行一样对齐 TextView

android - 如何在 Android 中平滑地实现放大缩小?与带有 RTMP 流的 SurfaceView 相关

android - 如何在我的应用程序中获取调用的手机号码?

java - 从自定义 OnClickListener 调用函数

Android Studio XML 使用 marginRight 和 API 17

android - 如何使用 ExoPlayer 从服务器流式传输 mp4 视频?

android - new AdapterView.OnItemClickListener(){}类型必须实现继承的抽象方法AdapterView.OnItemClickListener)

android - 如何替换旧 API<21 中的 NestedScrollView?