久久久久久久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 內(nèi)的 TextInputEditText 字段時,應用程序崩潰并出現(xiàn)此 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 設置 -> 系統(tǒng) -> 語言 &輸入 -> 高級 -> 自動填充服務 -> 無 ,然后專注于 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.

我們?nèi)绾卧诓唤迷O備上新的 8.0 自動填充服務的情況下防止崩潰發(fā)生?

推薦答案

我也遇到了.事實證明,問題是由嵌套在 TextInputLayout 內(nèi)的 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 發(fā)行說明中找到了這個塊.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>

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

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模板網(wǎng)!

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

相關文檔推薦

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 位小數(shù)的數(shù)字)
Changing where cursor starts in an expanded EditText(更改光標在展開的 EditText 中的開始位置)
EditText, adjustPan, ScrollView issue in android(android中的EditText,adjustPan,ScrollView問題)
主站蜘蛛池模板: 亚洲精品观看 | 日韩一区二区视频 | 免费黄色一级 | 国产成人一区 | 国产成人精 | 国产福利在线观看 | 一级片国产| 成人午夜在线视频 | av看片| 国产视频一区二区在线观看 | 亚洲第一黄色 | 精品一区二区在线播放 | 国产成人小视频 | 国产色站| 亚洲男人天堂网 | 四虎成人精品 | 亚洲高清在线播放 | 国产精品7777 | www.亚洲精品 | 亚洲精品福利视频 | 久久免费小视频 | 欧美一级淫片免费视频魅影视频 | 日本黄色视 | 秋霞一区二区 | 国产成人av一区二区三区在线观看 | 日本国产视频 | 国产在线观看网站 | 欧美激情网 | 久久久精品在线观看 | 亚洲天堂av网 | 91在线看片| 中日韩毛片 | 啪啪高潮动态图 | aaa一级片 | 超碰人人在线 | 天天天天躁天天爱天天碰2018 | 看一级黄色片 | 在线免费国产 | 天天干夜夜 | 国产在线麻豆精品观看 | 久久免费网 |