Instantiates a layout XML file into its corresponding View objects
Questions tagged [android-inflate]
651 questions
1
vote
1 answer
Inflating Exception when inflating view in Service while it's inflating normally in activity
When trying to inflate View like this:
val lay: LayoutInflater = getSystemService(LAYOUT_INFLATER_SERVICE) as (LayoutInflater)
mView = lay.inflate(R.layout.dialog_new_order, null)
I see a inflating exception:
Binary XML file line #0: Failed to…

Hani Hussein
- 159
- 4
1
vote
0 answers
Recruit-MP LightCalendarView - Error inflating class, noSuchMethodException
This is an odd one. Yesterday I added the following library as a dependency to my module level gradle in a simple empty default android project:
https://github.com/recruit-mp/LightCalendarView
I added the view to the activities layout file:

Thomas Cook
- 4,371
- 2
- 25
- 42
1
vote
2 answers
Why does ?android:textColorPrimary get different values with different API versions?
I have an app widget with a white background. Some of the text that displays uses ?android:textColorPrimary, some uses ?android:textColorSecondary, and some use colours I've defined.
For some reason though, when I run my app on pre Nougat (24 or…

Michael Vescovo
- 3,741
- 4
- 32
- 45
1
vote
0 answers
Inflate exception on EditText Longclick
This is a very strange bug that happens on a Galaxy Grand Prime on Android 5.0.1.
If I long-click any TextInputEditText or EditText, the app crashes with the following log:
FATAL EXCEPTION: main
…

Asim
- 6,962
- 8
- 38
- 61
1
vote
1 answer
Does inflate cache xml layouts?
When we inflate a layout does it get cached? If I recall correctly I have read that the inflate caches XML for performance. Is that correct? What exactly is being cached?

Jim
- 18,826
- 34
- 135
- 254
1
vote
1 answer
How to inflate a framelayout in an Activity dynamically with databinding?
I have read the following Android include layout dynamically with data-binding library question. My problem is a bit different.
I have two xml one for the the Activity:

codeme
- 861
- 2
- 12
- 29
1
vote
1 answer
Button not appearing if layout expands too large
I have what I believe to be a simple LinearLayout for an activity:

Dr_StrangeKill
- 75
- 8
1
vote
0 answers
Error inflating MapView
I'm trying to show a MapView inside a Fragment and I get an error when I inflate it:
03-21 14:34:44.234 32691-32691/com.example.javiersanzrozalen.fatrunners E/AndroidRuntime: FATAL EXCEPTION: main
Process:…

TibiaZ
- 730
- 1
- 8
- 21
1
vote
1 answer
Error inflating class with custom Listener
I had to write selection Listener for EditText. When I try to launch my app, it crashes when reaches setContentView(R.layout.activity_main); with this error message:
java.lang.RuntimeException: Unable to start activity…

Noqrax
- 1,049
- 2
- 8
- 15
1
vote
1 answer
unable to set android:windowBackground Error inflation on item requires drawable child
In my application to avoid cold start I have defined a theme fro my splash activity and set its android:windowBackground property to my one of drawables but I am getting an inflation error.
tag requires a 'drawable' attribute or child tag…

Mehvish Ali
- 732
- 2
- 10
- 34
1
vote
2 answers
Why isn't the Button in a TableRow aligned properly when created with XML, but it's aligned correctly when created programmatically?
When I create the rows in the Android Studio Design tab, the button within the rows don't seem to be properly aligned when I created them via XML.
However, when I programmatically add them via inflation, they get aligned properly (note that the…

Kiril
- 39,672
- 31
- 167
- 226
1
vote
2 answers
Error inflating class EditText in Android Tablet version 4.4.2
Hi all my application is working fine but I am getting a crash coming in Android Tablet with version 4.4.2 but don't know why as application is working fine in other versions perfectly. Error i am getting :
Fatal Exception:…

Kapil Rajput
- 11,429
- 9
- 50
- 65
1
vote
1 answer
Binding view with butterknife on android.R.layout.simple_list_item_1
I created an class that extends RecyclerView.Adapter.
I'm using as layout the android.R.layout.simple_list_item_1.
On my ViewHolder, I was trying to map it's TextView text1 on a TextView variable, using this:
myTextView = (TextView)…

Leonardo Sibela
- 1,613
- 1
- 18
- 39
1
vote
0 answers
Layout load recyclerView slowly
Activity loading layout file, if the layout contains RecyclerView, through startActivity into when the UI is particularly slow, there are about 0.5-2 seconds waiting time, but if you remove RecyclerView when enters the normal!Activity didn't write…

yuzhongxingke
- 31
- 5
1
vote
1 answer
Performance diff between two view adding approach
What will be the diff in terms of performance of adding views dynamically ( using add/remove view methods of ViewGroup ) or putting them into a static layout xml file and let it be compiled into a binary form and inflated at runtime ( regular way )…

stdout
- 2,471
- 2
- 31
- 40