Instantiates a layout XML file into its corresponding View objects
Questions tagged [android-inflate]
651 questions
2
votes
1 answer
android - custom ListView, getView method
alright, I voted to delete my previous similar question to keep it clean. The matter: I'm trying to use a custom ListView for displaying messages in a chat app. I now managed to set the text according to user's input but I have some troubles in the…

Droidman
- 11,485
- 17
- 93
- 141
2
votes
1 answer
How to set data to layout inflated by a fragment
I have a FragmentActivity which sets a main layout with 3 tabs. Each tab has it's own fragment which inflates is own layout into main layout.
For example, one of the three Fragments:
public class Fragment1 extends Fragment {
public View…

Cristiano
- 3,099
- 10
- 45
- 67
2
votes
2 answers
Android identical gen identifiers for different layouts
I have a project with some layouts and I'm linking to it from another project which also has its own layouts. The problem is that it causes duplicate identifiers, so when I'm trying to inflate a layout from one of the projects, I'm getting the…

user940016
- 2,878
- 7
- 35
- 56
2
votes
3 answers
Inflated AlertDialogs unreadable on Android 4.X while looking perfect on Android 2.X
In order to show dialogs with rich content and input elements, I use Android's AlertDialog.Builder to create an object of AlertDialog and then I use the system's LayoutInflater to set the content (setView(...)) to some XML layout file.
This looks…

caw
- 30,999
- 61
- 181
- 291
2
votes
1 answer
Memory usage in ListView with dynamic layout data
I am working on a custom ListView with nested data for each row. I want to show a person's name with a checkbox for each line, and then dynamically add sub-rows to the ListView for 1-to-many phone numbers associated with that person.
That is…

Blather
- 1,118
- 5
- 15
- 25
2
votes
1 answer
Android extending linear layout and inflate
I'm extending a linear layout wich contains 2 TextView.
The TextViews are inflated from template layouts I created.
My problem is that the backgrund that I set is covering the entire raw, instead only the part that contains text. But, when I'm…

dvircn
- 357
- 2
- 5
2
votes
2 answers
How to findViewById form another XML file?
I connent an addevent.java with addevent.xml is content a listview, the listview take its element from another XML file "item.xml"

SWE
- 131
- 2
- 7
- 20
2
votes
3 answers
how to choose what view will be on top in android
I'm trying to add a View on top of another one.
First I am setting a view via the xml and then I want to add the second one programatically.
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
…

roiberg
- 13,629
- 12
- 60
- 91
1
vote
1 answer
Error inflating class switch, ActionBarSherlock (InflateException)
I'm running into a pain of an error. I have a SherlockFragmentActivity, and at least two SherlockFragments. Both use onCreateView to inflate an xml file. LoginFragment, however, has a switch widget: econ fragment does not. If I add a switch widget…

Davek804
- 2,804
- 4
- 26
- 55
1
vote
1 answer
Displaying multiple xml views w/o fragments
In my app the user spins a carousel. On the selected Item I need to display a separate xml view for each item. The carousel is visibile at all time at the bottom with the view visible in the top half. I think that there is a better way than to use…

KDEx
- 3,505
- 4
- 31
- 39
1
vote
0 answers
Inflating PreferenceScreens at runtime
I have a PreferenceActivity which should display a PreferenceScreen for each of the entries in a list in my app. However, the list is only known at runtime, and so I can't define them in XML. I would like to define a generic screen in XML and then…

Shawn Lauzon
- 6,234
- 4
- 35
- 46
1
vote
1 answer
This works, but is it the "right" way?
I'm reusing the ListView AND the LayoutInflater here for both a header and a footer:
ListView lv = getListView();
LayoutInflater inflater = getLayoutInflater();
View header = (View)inflater.inflate(R.layout.header, lv,…

B. Clay Shannon-B. Crow Raven
- 8,547
- 144
- 472
- 862
1
vote
1 answer
Layout parameters don't apply when inflating content from layout XML on custom ViewGroup
I'm using the LayoutInflater to add a layout into a custom ViewGroup (not a subclass of ...Layout but a simple ViewGroup).
After a short battle with it, and after implementing all that was said in this post, I managed to make the content to finally…

Igor K.
- 750
- 9
- 25
1
vote
2 answers
Error inflating class which I know is a webview
I need help, I have an application published on the market using a webview to present information.. Every now and then i get error reports like this one:
http://pastebin.com/zQ16Sf2z
The error points to my inflation-line of my…

DagW
- 955
- 1
- 15
- 28
1
vote
0 answers
Access custom view properties after inflation in Android
I have an activity with a LinearLayout which I want to add multiple buttons to. These buttons are Custom Views which I inflate. I need to add these custom buttons to my Linear Layout in code. All of this works.
What I cant get to work is to use…

Moresby
- 79
- 7