Questions tagged [layout-inflater]

The layout-inflater tag refers to the Android LayoutInflater class which is used to build a view hierarchy from an xml layout file.

The LayoutInflater class will build a view hierarchy from the XML layout, taking care of instantiating the views and setting them with the attributes values present in that layout file. This class can't be used directly, instead a reference to a valid LayoutInflater object can be obtained by using one of the methods of the Activity class or by getting it from the system services.

The usage of the LayoutInflater is simple: just use one of the inflate() methods and provide it the id of the XML layout file (in the form of R.layout.layout_file) along with other desired parameters. More information can be found in the documentation of the class.

1229 questions
0
votes
0 answers

Popup window - how to exit and click another view on the main layout with one click

I have a popup window in my Android application that does not follow the behavior I want. I can create the popup window as an anchor from a view and it closes when I touch out of the popup area. But I am unable to perform any actions with this…
Matt
  • 1,017
  • 2
  • 11
  • 27
0
votes
0 answers

android inflateexception masking memory error

Some of my user crash reports are inflate exceptions, these are mainly due to memory errors that some devices get. Only about 0.2% of users get these for this particular app, but the devices themselves are not exactly low-end fringe devices. How can…
CQM
  • 42,592
  • 75
  • 224
  • 366
0
votes
1 answer

Set values to textview in Toast programatically

I need to access inner textview via layout inflater sudo hirarchy: I want to dynamically set value…
M P Mathugama
  • 1,418
  • 1
  • 20
  • 31
0
votes
0 answers

ListView Custom Layout setText not working

I am trying to set the text of some TextViews in my custom ListView Layout. I am using a ListFragmentBTW. I am returning the actual ListView Layout in OnCreateView and I am inflating the Custom Layout ind OnActivityCreated. Don't Really know if this…
mike.b93
  • 1,989
  • 2
  • 18
  • 31
0
votes
2 answers

Android: Update ListViewItem with new .xml from code

I have a ListView with an OnClick-method, which I want to change the layout of the clicked ListViewItem. I want to do this by setting the layout to a new XML. As the view loads I set the items' default layout in the ArrayAdapter's getView-method…
0
votes
2 answers

PullToRefreshGridView Inflate Exception

I am using this library https://github.com/chrisbanes/Android-PullToRefresh for implementing a refreshable grid view and i am getting this error: android.view.InflateException: Binary XML file line #8: Error inflating class…
0
votes
0 answers

Editext inside the popupwindow shows bad token error in android?

Am using Edit text inside the popup window after am enter the values in edit text it shows some bad token error.Can any one know please help me to solve this issue. My Pop up window Coding. inflater1 = (LayoutInflater)…
Yugesh
  • 4,030
  • 9
  • 57
  • 97
0
votes
6 answers

Why root View return from inflate() does not match with View returned from findViewById()?

As a new-bee I am again in trouble understanding some basics of inflate(). here is my xml file -
0
votes
0 answers

Whats wrong with LayoutInflater?

In my app I have gridview. I want it to display complicated items with an image and some textviews. Here is my inflatable item
TrueCH
  • 501
  • 1
  • 6
  • 18
0
votes
1 answer

Is view inflation cached in Activity

I tried searching for a clear answer but could not find it so asking it here. Apologies if this is a nOOb question. My question is Does Android Cache the view inflation outside the scope of the activity? I wrote a sample app in which there are 2…
0
votes
1 answer

How to inflate buttons and create listeners for each one of them?

I want to create a variable number of buttons, and I want them to be adjacent (I cannot use the ListView), so I know I have to inflate a Button somehow. My question is how to inflate the Button, and for each of the created buttons, how to create a…
Nashwan
  • 63
  • 1
  • 11
0
votes
2 answers

How to modify a View from the MainActivity in another class?

I would like update a GridView that I have created in my MainActivity from another class, in my case, called GameplayController. Specifically, I am trying to simply insert the gridView.setOnItemClickListener(....)... that I currently I have in the…
ChrisWilson4
  • 195
  • 4
  • 23
0
votes
1 answer

Null Pointer exception when trying to layout inflate in service

I'm trying to layout Inflate in a service on onCreate with this code: // ... public void onCreate() { telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); call = new PhoneCall(); IntentFilter…
Reza_Rg
  • 3,345
  • 7
  • 32
  • 48
0
votes
1 answer

how to set a textview in inflater layout for close mark?

I'm new to android I'm facing a problem in inflate layout to set close mark How to set close mark in inflater? how to implement this? Any one help me. I try like this.. LayoutInflater inflater = (LayoutInflater)…
Make it Simple
  • 1,832
  • 5
  • 32
  • 57
0
votes
1 answer

Dynamic resource id for inflater.inflate

I am having the dynamic layout as like the below code. linearLayout=new LinearLayout(sActiveContext); linearLayout.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT)); …
Karthick
  • 1,241
  • 5
  • 20
  • 43