久久久久久久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在线免费观看网址 | 91黄色免费看| 国产区免费视频 | 在线播放第一页 | 一区二区三区视频 | 国产三级日本三级 | 大香网伊人 | 97国产一区二区精品久久呦 | 久久亚洲春色中文字幕久久久 | 国产成人99久久亚洲综合精品 | 盗摄精品av一区二区三区 | www.国产91| 亚洲精品电影 | 国产亚洲欧美在线视频 | 午夜视频导航 | av免费网站在线观看 | 欧美9999| 日韩成人精品一区二区三区 | av网站免费 | 欧美一级大片免费看 | 久热中文字幕 | 日本二区在线观看 | 麻豆hd| 国产我和子的乱视频网站 | 亚洲视频在线一区 | 中国美女一级黄色片 | 欧美一级片中文字幕 | 久久久精品网站 | 综合久久一区 | 日韩福利视频 | 欧美video | 久操国产| 国产欧美日韩精品一区 | 国产精品色哟哟网站 | 欧美一区二区网站 | 在线观看免费福利 | 亚洲一区视频在线 | 在线看日韩av | 亚洲大片在线观看 | 亚洲在线一区二区 | 国产乱码精品1区2区3区 |