Instantiates a layout XML file into its corresponding View objects
Questions tagged [android-inflate]
651 questions
1
vote
2 answers
Buttons in other two inflated layout return a Null Pointer Exception
I have a Tab View with three layouts. Each layout is divided into 4 parts using Frame layout and each one has a button. So there are total of 12 buttons. Since the View is First Layout, buttons in other two layouts return a null pointer exception. I…

Jay Dadarkar
- 11
- 1
1
vote
1 answer
Interesting thread behavior when Layout Inflater inflates EditText
When watching my app through the Device Manager I came across behaviour with the inflater that I was hoping someone in the stack overflow community could help me understand. I have a fragment that when It uses the layout inflater to inflate an…

nbroeking
- 8,360
- 5
- 20
- 40
1
vote
3 answers
android - adding views is too slow
I need to add about 10 views to ScrollView and I use the following code
final LinearLayout item_div = (LinearLayout)activity.findViewById(R.id.item_div);
final LayoutInflater inflater =…

Mohsen Shakiba
- 1,762
- 3
- 22
- 41
1
vote
2 answers
Change TextView value from Non-Activity class
I'm trying to setText a new value to my TextView from a non activity class by inflating the layout where the textview is, but I'm still unsuccessful though I'm able to getText the current value of the TV. Here's the code:
LayoutInflater mInflater =…

user3360031
- 627
- 4
- 13
- 21
1
vote
1 answer
Get xml View or Context from Xposed Module
I'm developing a Xposed module, I've searched and I haven't found the answer.
But I've found this and I don't know how/what getObjectField() work/need, and also I've found this but it need my app context. I can get a context from the system but I…

Gabriel Rohden
- 1,307
- 9
- 19
1
vote
1 answer
Changing ImageView from a different activity
I am making an application, and I want to change an image inside some layout from another layout. Is that possible? Here is the case, the details activity contains spinner which has the items important and draft, and there is a save button which…

Dania
- 67
- 3
- 12
1
vote
1 answer
Error inflating a ListView
I have a class that extends from a Faragment, called Agenda. Its layout has a listView, but I get an error when infating the view this class returns to the main activity. Here is the error and code:
> 03-11 13:50:55.553 …

Victor Muñoz
- 11
- 1
1
vote
2 answers
How to inflate a ListView to a View
I'm new here so i will try to explain my problems as good as i can.
I am trying to inflate a ListView into a View in my main activity. My main activity has some buttons and texts on the top of the Activity and there is enough space left for the…

Painful
- 137
- 1
- 11
1
vote
0 answers
what is the cause of binary xml file line #6 error inflating class fragment
i'm stuck with binary xml file line #6 error inflating class fragment exception ... i'm using a 3rd party library in creating my view... i need to know when exactly this exception is thrown in general, so i can work around it i have tried to remove…

ahmed adel
- 89
- 3
- 12
1
vote
1 answer
reference to a view in an inflated layout
I have a layout that contains 4 ImageViews with these id's: opp11, opp12, opp13, opp14.
I inflate this layout using:
public class FourOptions extends LinearLayout {
public FourOptions(Context context, AttributeSet attrs) {
super(context,…

Maor Yichyeh
- 97
- 1
- 9
1
vote
1 answer
Android: Inflate a Movable button at center of a RelativeLayout
I would like to inflate a moveable button in the center of a relativelayout (Container), such that when touching it, it can be moved within Container, i.e. the screen.
Code is as follows:
public void inflate_floating_btn(int k)
{
…

pearmak
- 4,979
- 15
- 64
- 122
1
vote
2 answers
Android: Can't add header to ListView (LinearLayout can't be cast in AbsListView)
I am trying to add a header with a ImageView to my ListView. I put the ImageView in an XML layout and in the Activity I am inflating the layout and add it to the ListView header, but when I run the app it crashes saying…

emedrado
- 21
- 4
1
vote
1 answer
Android passing R.layout.extra_layout to View.inflate dynamically
I'm trying to programmatically pass the id of a layout.xml file to the View.inflate method but am not sure how I could go about that. I have a test bit of code that I'm tring to get working and, as you'll see I've tried passing this in as a String…

Roger W
- 107
- 1
- 4
- 16
1
vote
0 answers
Fragment layout inflate optimization
I'm creating an app which has only one Activity, a FragmentActivity who works like a "ViewPager dashboard" with some option pages (ViewPager Fragments) and for each page I've some options buttons. This option buttons toggle a SlideUp Menu (SM) that…

GuilhE
- 11,591
- 16
- 75
- 116
1
vote
2 answers
Change shape on an inflated View - Android
I have the following shapes :
1)quizgeneralanswershape.xml:

Menelaos Kotsollaris
- 5,776
- 9
- 54
- 68