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

Custom adapter getting a NullPointerException with Inflator

I have an adapter that gets a list of items from an API and then puts it in a listview. This is the first time that Im working with adapters and list views and so far Im struggling quite a lot! Why am I getting this error? Is my context wrong or…
Harry
  • 13,091
  • 29
  • 107
  • 167
0
votes
1 answer

How to Show Network Connectivity Status to User

My app works only if there is network connectivity. So, I check for the same on the app startup and resume. I have a broadcast receiver which listens to network changes. If there is no Network, I want to show a Simple 'No Network Connectivity'…
andy
  • 484
  • 8
  • 21
0
votes
3 answers

ListView in alertdialog not displaying correctly when using holoeverywhere

I am using the Holoeverywhere compatibility library along with the sherlockActionbar library. The problem i am having is that when i inflate the view in the DialogFragment class, it doesnt display corrrectly on pre 3.0 devices public static class…
0
votes
0 answers

How to inflate the icon image in my layout?

I am trying to add a small home icon image to top of my list view.Below you can see the code of my adapter. It works perfectly for setting dynamic text but it fails when i want to add an image. I do not get any runtime error, just the images…
Make it Simple
  • 1,832
  • 5
  • 32
  • 57
0
votes
2 answers

Gridview inside listview in android facing android.view.InflateException problems

I have to create the custom gridview within text and listview in android application. Here i have to display the category name on gridview and if the categoryname is matches which means have to display the list is display on listview below the…
0
votes
1 answer

Why isn't the inflated viewGroup working?

So basically, I'm trying to change the font on all the views of a xml layout. This can only be done through a non-xml approach. For some reason, setFont will not work with my inflated view group child. I think I'm going about the viewGroup wrong...…
Kohler Fryer
  • 89
  • 2
  • 7
0
votes
1 answer

Android ListView Repeating Elements In Child Layout

All graphs in the vybrations arraylist are unique but getView is repeating the elements for the list. I am correctly using convertView but it is still repeating the same drawings across the list. I don't know what am I doing wrong here? Here's the…
Bam
  • 1,183
  • 1
  • 9
  • 13
0
votes
1 answer

Inflating GUI works only once, how come?

I'm new to Android development. I have Activity, to which I wish to add some GUI-elements. @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_dial_details); …
kaze
  • 4,299
  • 12
  • 53
  • 74
0
votes
1 answer

Why Is TabWidget/TabHost not working?

I'm a noob to android development and I am trying to make custom tabs. However, when I run my application the tabs fill the entire height of the screen and for some reason makes the soft keyboard appear during OnCreate. I can't determine whether…
B. Money
  • 931
  • 2
  • 19
  • 56
0
votes
1 answer

Main activity layoutInflater, activity don't start

When i hit the plbutton1 i don't take result. When i hit the plbutton2 the activity R.layout.paraggeleia open corect. Can anyone help me? Where i make wrong? Here is my code!!!! public View onCreateView(LayoutInflater inflater, ViewGroup…
0
votes
3 answers

Adapter for displaying list view

In my application i have an class extending dialog fragment. The class displays normal dialog(not Alert dialog). 1.displaying a listview inside dialog. the list view contains 2 text views , both are populated by 2 string arrays. I am confused about…
user1526671
  • 817
  • 4
  • 16
  • 33
0
votes
2 answers

How to show date picker in popup window that popped from an imagebutton

I am building application in which I need this complex mechanism. Please help me out. When I click on the imagebutton it should show a popup window. In this popup window I've kept two editTexts. I've set both editTexts to OnclickListener. Now when i…
0
votes
2 answers

Closing an AlertDialog box after a button has been clicked

I have the following code which displays a dialog box to the user if no network connection is detected. private void createNoNetworkDialog() { LayoutInflater inflater = LayoutInflater.from(this); AlertDialog.Builder builder = new…
TomSelleck
  • 6,706
  • 22
  • 82
  • 151
0
votes
1 answer

How to inflate custom layout in runtime while avoiding redundant layout in the view hierarchy - Android

In general, I want to know how should I inflate custom layout defined in XML at runtime without having a redundant layout in my views hierarchy. Now, in particular: I have a custom layout which is declared in an xml, my_relative_layout.xml and its…
0
votes
2 answers

AsyncTask LayoutInflater InflateException on EditText

I Basicly have code new AsyncTask() { @Override protected View doInBackground(Integer... tabIds) { return mInflater.inflate(R.layout.layout_name, null); } @Override protected void onPostExecute(View result) { …