久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Android 8.0 Oreo 在聚焦 TextInputEditText 時崩潰

Android 8.0 Oreo crash on focusing TextInputEditText(Android 8.0 Oreo 在聚焦 TextInputEditText 時崩潰)
本文介紹了Android 8.0 Oreo 在聚焦 TextInputEditText 時崩潰的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

將我們的一些設備更新到 android 8.0 后,在關注 TextInputLayout 內的 TextInputEditText 字段時,應用程序崩潰并出現此 Exception:

After updating some of our devices to android 8.0 , upon focusing on a TextInputEditText field inside of a TextInputLayout, the app crashes with this Exception:

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void
android.view.View.getBoundsOnScreen(android.graphics.Rect)' on a null object reference
at android.app.assist.AssistStructure$WindowNode.(AssistStructure.java)
at android.app.assist.AssistStructure.(AssistStructure.java)
at android.app.ActivityThread.handleRequestAssistContextExtras(ActivityThread.java:3035)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1807)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

當我們進入 android 設置 -> 系統 -> 語言 &輸入 -> 高級 -> 自動填充服務 -> 無 ,然后專注于 TextInputEditText / TextInputLayout 不再崩潰.

When we go to android Settings -> System -> Languages & input -> Advanced -> Auto-fill service -> None , then focusing on the TextInputEditText / TextInputLayout no longer crashes.

我們如何在不禁用設備上新的 8.0 自動填充服務的情況下防止崩潰發生?

推薦答案

我也遇到了.事實證明,問題是由嵌套在 TextInputLayout 內的 EditText 上設置提示文本引起的.

I ran into this too. It turns out the issue was caused by setting the hint text on the EditText nested inside the TextInputLayout.

我進行了一些挖掘,并在 26.0.0 Beta 2 發行說明中找到了這個塊.2017 年 6 月 Android 支持版本說明

I did some digging and found this nugget in the 26.0.0 Beta 2 release notes. Android Support Release Notes June 2017

TextInputLayout 必須在 onProvideAutofillStructure() 上設置提示

TextInputLayout must set hints on onProvideAutofillStructure()

這導致我嘗試在 TextInputLayout 而不是嵌套的 EditText 上設置提示.

That led me to try setting the hint on the TextInputLayout instead of the nested EditText.

這為我解決了崩潰問題.示例:

This resolved the crashing issue for me. Example:

<android.support.design.widget.TextInputLayout
    android:id="@+id/textInputLayout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:hint="Some Hint Text"
    android.support.design:hintAnimationEnabled="true"
    android.support.design:hintEnabled="true"
    android.support.design:layout_marginTop="16dp">

    <android.support.design.widget.TextInputEditText
        android:id="@+id/editText"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>

</android.support.design.widget.TextInputLayout>

我將此作為答案發布在這里 因為我把書簽弄混了.很抱歉兩次發布相同的答案.

I posted this as an answer here as I mixed up bookmarks. Sorry for posting the same answer twice.

這篇關于Android 8.0 Oreo 在聚焦 TextInputEditText 時崩潰的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Cut, copy, paste in android(在android中剪切、復制、粘貼)
android EditText blends into background(android EditText 融入背景)
Change Line Color of EditText - Android(更改 EditText 的線條顏色 - Android)
EditText showing numbers with 2 decimals at all times(EditText 始終顯示帶 2 位小數的數字)
Changing where cursor starts in an expanded EditText(更改光標在展開的 EditText 中的開始位置)
EditText, adjustPan, ScrollView issue in android(android中的EditText,adjustPan,ScrollView問題)
主站蜘蛛池模板: 中文字幕av网站 | 精品久久不卡 | 精品久久久久久久久久久 | 午夜免费电影 | 欧美a∨ | 国产午夜精品久久久 | 国产一区二区三区精品久久久 | 麻豆精品国产91久久久久久 | 国产一区精品 | 精品日本久久久久久久久久 | 四虎影院一区二区 | 成人不卡| 久久中文字幕一区 | 中文字幕 视频一区 | 九九精品久久久 | 欧美日韩国产三级 | 国产jizz女人多喷水99 | 日本精品免费在线观看 | 久久精品福利视频 | 国产高清一区二区 | 成人欧美一区二区三区黑人孕妇 | 成人一区二区三区 | 色妞av| 亚洲综合免费 | 国产精品国产成人国产三级 | 国产精品完整版 | av在线天堂 | 亚洲免费一区 | 中文字幕1区2区 | 国产精品日女人 | 天天操狠狠操 | 在线观看亚洲专区 | www免费视频| 国产丝袜av | 亚洲一区不卡 | 日韩欧美在线视频播放 | 视频二区在线观看 | 麻豆av免费观看 | 在线看一区二区 | 久久不卡 | 久久久久久亚洲精品 |