AsyncLayoutInflater with Webview - android

I was trying to use AsyncLayoutInflater with WebView, but inflation failed on the background thread:
Failed to inflate resource in the background! Retrying on the UI thread
android.view.InflateException: Binary XML file line #6: Binary XML file line #6: Error inflating class android.webkit.WebView
Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class android.webkit.WebView
I assume this means that WebView cannot be inflated asynchronously because it makes use of Handler internally, at least using AsyncLayoutInflater.
Is there any way around this?

Related

Is there a limitation in length of TextView

I'm developing Android App and I'amm putting some strings that reach 20,653Bytes in TextView.
When I build and execute on API 22 device, it works. However, When building on API 26 device, IndexOutOfBoundsException error occured like below.
Caused by: android.view.InflateException: Binary XML file line #61: Binary XML file line #61: Error inflating class TextView
Caused by: android.view.InflateException: Binary XML file line #61: Error inflating class TextView
Caused by: java.lang.IndexOutOfBoundsException
How to solve this error? I have to display this text at at time.
I just solved like below.
Save text(formed in html) in String variable, and then,
tvContent.setText(Html.fromHtml(html1));
When I just used strings.xml, it didn't work.

Exception when trying to use a <vector> as src for an ImageView

I have in one of my layout files.
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
app:srcCompat="#drawable/ic_app"
android:layout_gravity="center"/>
My ic_app.xml is located in flavor/res/drawable. I notice that if I move the icon into main/res/drawable. Everything is working again!
The drawable ic_app is an XML. But for some reason, my android API-23 phone would crash whenever this activity is launched that contains this ImageView. Saying that the resource is not found.
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.myapp/com.app.android.view.activity.login.WelcomeActivity}: android.view.InflateException: Binary XML file line #20: Binary XML file line #20: Error inflating class ImageView
Caused by: android.view.InflateException: Binary XML file line #20: Binary XML file line #20: Error inflating class ImageView
Caused by: android.view.InflateException: Binary XML file line #20: Error inflating class ImageView
Caused by: android.content.res.Resources$NotFoundException: File res/drawable/ic_app.xml from drawable resource ID #0x7f02029e
I have never seen this happening before. What could the cause be?
The same app runs correctly in an API-19 device.
If you are using vector drawables, use
app:srcCompat="#drawable/ic_app"
instead of
android:src="#drawable/ic_app"
Here is a Good Read
Try to use app:srcCompat="#drawable/ic_app" instead of android:src="#drawable/ic_app".
I've found this
Firstly, when using AppCompat with ImageView (or subclasses such as ImageButton and FloatingActionButton), you’ll be able to use the new app:srcCompat attribute to reference vector drawables (as well as any other drawable available to android:src):
On this Blog

android 8.0 user-defined view Application Crash

When I use my application in Android 8.0, it crashes. Here is the log:
android.view.InflateException: Binary XML file line #7: Binary XML file line #7: Error inflating class com.**.**.XListView
android.view.InflateException: Binary XML file line #7: Error inflating class com.****
java.lang.ClassNotFoundException: Can't find class com.****. installed bundles
The *** was hidden by me.
XListView is a user-defined view that extends ListView.
But when I use the application on a lower version, like Android 7.1, 7.0, 6.0, 5.0... it works normally.
What can I do to resolve it?

android.view.InflateException:Binary XML file line #18:Error inflating class android.support.design.widget.NavigationView

java.lang.RuntimeException: Unable to start activity ComponentInfo{cab.app.book/com.epbit.ccv3.MainActivity}: android.view.InflateException: Binary XML file line #18: Error inflating class android
support.design.widget.NavigationView.
Added design and appcompat library and Tried in all the ways, but unable to solve the issue.
Please help
Your layout's file has an error in line 18.

Android Studio error "android.view.InflateException: Binary XML file line #26: Error inflating class " when trying to use GeckoView

So, I'm trying to use GeckoView in my Android app. When I run my app I get this error:
"Process: com.example.planetarium_3d, PID: 1586
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.example.planetarium_3d/com.example.planetarium_3d.Fullscree nActivity}: android.view.InflateException: Binary XML file line #26: Error inflating class org.mozilla.gecko.GeckoView"
I've placed the .jar files in my libs folder - !http://i.imgur.com/kSFwHzd.png?1
This is my code: http://pastebin.com/kGCjfuAC
This is my activity xml file: http://pastebin.com/s8GYnucS
And this is error log: http://pastebin.com/2yXR6imZ
How can I resolve this issue ?
Exception:
android.view.InflateException: Binary XML file line #26: Error
inflating class org.mozilla.gecko.GeckoView"
Inside your Activity xml file, you dont need class = "org.mozilla.gecko":
<org.mozilla.gecko.GeckoView
android:id="#+id/geckoViewObj"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>

Categories

Resources