Instantiates a layout XML file into its corresponding View objects
Questions tagged [android-inflate]
651 questions
2
votes
1 answer
Android DialogFragment and Unable to start activity ComponentInfo after killing/restoring app
I have app working fine until one very specific scenario.
I open the dialog.
I kill the app (using SystemTuner)
I restore app after being killed.
Then my app is not run and the following messages are in LogCat.
07-05 20:45:36.469:…

user2707175
- 1,133
- 2
- 17
- 44
2
votes
1 answer
What's the earliest point in time I can access xml-defined subviews in a custom view
I have this xml file:

Kuno
- 3,492
- 2
- 28
- 44
2
votes
3 answers
Android: Error inflating class PreferenceScreen
Please help me out here, I'm hitting brick wall for the last two days and can't figure it out.
I have a simple PreferenceFragment and would like to inflate it from an Activity.
Here is the res/xml/preferences.xml:

tarja
- 61
- 1
- 2
- 8
2
votes
2 answers
Inflate into "this"?
I've been creating apps without much XML, creating views programmatically. I'd like to switch to XML. So I wrote an XML file for a RelativeLayout, and I need to inflate it into an existing class (a subclass of RelativeLayout, of course) that has…

user1334767
- 587
- 4
- 17
2
votes
1 answer
Inflate layout in an activity with PreferenceFragment
My custom FragmentSettings() extends android.preference.PreferenceFragment and I simply add it in my activity.
I want to inflate (add) as well the layout.logo which has gravity:bottom. However with my code the inflated layout.logo is not visible. I…

Diolor
- 13,181
- 30
- 111
- 179
2
votes
0 answers
Android inflate(R.layout.xyz, parent, false) leads to empty rows in CursorAdapter
I've been chasing this bug for a few hours, and now that I've finally fixed it, I don't understand what caused it in the first place. I have a custom CursorAdapter with the following piece of code (full code posted at the end):
@Override
public View…

Vicky Chijwani
- 10,191
- 6
- 56
- 79
2
votes
0 answers
Inflating objects from XML
I am trying to write a custom camera app, and so to get some ideas for my camera, I downloaded the google camera app and have stripped out features I don't need.
I am having an issue, however, with part of the code that reads in an XML file and…

Josh
- 16,286
- 25
- 113
- 158
2
votes
1 answer
Android.view.InflateException: Error inflating class fragment on Startup (no error in onCreate?)
I'm getting "Error inflating Class Fragment" error in XML- file when the app starts. I don't understand why?
I've tried replacing the class- file that's causing the error with a similar file, used in another project that doesn't get this error, but…

Sluggo
- 597
- 1
- 9
- 21
2
votes
4 answers
(Android GridView) CheckBox of the first item not work when I recycled convertView
I deleted almost all code in my project to find a hiding bug. There was a GridView that containing a frame layout, and the layout contained CheckBox. But I couldn't check the first check box.(others worked)
Finally (I think) I found an answer. But…

margincall
- 483
- 1
- 6
- 24
2
votes
2 answers
How to restart onCreateInputView()?
I have a keyboard with a onCreateInputView() method, I have to edit the keyboard dinamically and I have to restard the onCreateInputView() when particular preferences changes

totzi10
- 135
- 9
2
votes
2 answers
ActionBarView Inflate Crash
I'm getting this crash report from a few users. They are using Samsung SPH-M840 Android version 4.1. The layout I am inflating is a simple FrameLayout with a fragment tag inside it. I am using actionbar-compat.
java.lang.RuntimeException: Unable…

Eliezer
- 7,209
- 12
- 56
- 103
2
votes
1 answer
Create a Line Dynamically Android
I want to create a underline dynamically in the UI.I have tried but i am not able to do that please help me
This is my xml file
user2568702
2
votes
2 answers
Modify spinner's dropdown box programmatically
How can I programmatically change the Padding and TextSize of the items in the spinner's dropdown box?
I tried using XML but the padding and text size appears different on different screen sizes. I need to perform a couple of simple calculations…

Dan Bray
- 7,242
- 3
- 52
- 70
2
votes
1 answer
How to remove View in Android?
I have two Buttons which is in main layout. If Add Button is clicked it has to add EditText dynamically(Using Inflater). This part is working. If Remove Button is clicked it has to remove those EditText with last in first out.But I don't know how…

DroidLearner
- 2,115
- 5
- 31
- 50
2
votes
3 answers
Get item view from ActionBar
I have an ActionBarSherlock with one menu item in my bar. When I'm call
View item = findViewById(R.id.my_item);in activity's button onClick all works fine as expected.
But when I try to do this in onCreate or onResume or even in onPostResume it is…

Dmitriy Tarasov
- 1,949
- 20
- 37