Instantiates a layout XML file into its corresponding View objects
Questions tagged [android-inflate]
651 questions
2
votes
1 answer
Android Java Use a cardview to display the items of a gridview
Hi everyone I'm trying to show with a GridView some items that show the contents of an array of strings. This is the CardView I want to set as item:
So when I click on a button, the layout of the choice of the type of film becomes visible and I set…
2
votes
1 answer
Programmatically Adding views in inflated layout
I am trying to add views in linear layout programmatically which is a part of inflated view but after adding views in linear layout it is not displaying
MainActivity code:-
final LayoutInflater inflater = this.getLayoutInflater();
…

PRANAV SINGH
- 1,000
- 11
- 17
2
votes
1 answer
Binary XML file line #2: Error inflating class android.widget.LinearLayout
I am completely lost with this one. My app works perfectly on API 2.1 on my handset and through the emulator.
I have just run it through a 2.2 emulator and I am getting a crash and this error:
04-27 20:29:41.293: ERROR/AndroidRuntime(341):…

Atkobeau
- 109
- 1
- 2
- 9
2
votes
2 answers
Grey-out settings based on master on/off Switch?
I am fairly new to inflating things in Android, and am creating my first Settings screen for my App.
I want my Settings/Preferences screen to have a "master" On/Off Switch in the top-right of the ActionBar, which "greys-out" the settings when…

Studio2bDesigns
- 578
- 5
- 12
2
votes
3 answers
binary xml file line error inflating bottom navigation view on lower android version
I'm a beginner in android programming and I've been trying to implement the bottom navigation view in my app to work on API 17 and above but on running the app on my API 22 Lollipop phone the app crashes and it also crashes on all other android…

Dexter Brian
- 41
- 4
2
votes
1 answer
AuthUI.IdpConfig.EmailBuilder() inflate view error
I need to use firebase-ui-auth in my programm...
// Choose authentication providers
List providers = Arrays.asList(
new AuthUI.IdpConfig.EmailBuilder().build(),
new AuthUI.IdpConfig.GoogleBuilder().build());
// Create and…

francesco freddi
- 19
- 1
- 10
2
votes
0 answers
Change the background color of a menu (inflater)
How can I change the background color of a menu (inflater)?
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
if (v.getId() ==…

Davy Bartoloni
- 21
- 5
2
votes
1 answer
Can't inflate Fragment dynamically
I am following this tutorial to inflate fragments in default Navigation drawer activity in Android Studio.
After compiling I get the following error in logcat:
java.lang.RuntimeException: Unable to start activity…

mayur newase
- 66
- 7
2
votes
1 answer
inflate a layout which is included in another layout which include other layout
The title might be confusing but that's my situation, I have a layout: get_my_sensors_activity.xml which includes this: app_bar_get_sensors.xml and that one includes: content_get_my_sensors.xml. In the last one: content_get_my_sensors.xml, I have a…

CarlosNavas91
- 51
- 6
2
votes
1 answer
Can I turn an XML-layout into a drawable?
So I want to put an xml-layout as a background to a view, but then it has to be a drawable. So is there any way to turn an it into a drawable?
I've also tried inflating it, but nothing works the way I want :(
Thx in advance.

David Dahlgren
- 23
- 1
- 4
2
votes
0 answers
onOptionsItemSelected is called for wrong fragment (different fragment from backstack)
I have an issue with onOptionsItemSelected event.
My application consist of Activity, main fragment, multiple function fragments.
Activity's FragmentManager contains only one Fragment (MainFragment).
MainFragment's ChildFragmentManager contains up…

Marian Przyszedł
- 699
- 1
- 9
- 19
2
votes
1 answer
Creating layout dynamically from template
Is it possible to load a layout XML at runtime and load into activity?
In my app, I have various types of data like Person, Company, City, etc; The requirement is to dynamically load the layout, find views by tags (property names like Person.name,…

ankitjaininfo
- 11,961
- 7
- 52
- 75
2
votes
1 answer
Viewstub not displacing adjacent views once inflated. Solution?
I have a ViewStub inside a DrawerLayout, and I plan to inflate and remove this stub dynamically according to the needs of the user.
The drawer consists of a RelativeLayout containing:
1. A TextView
2. The mentioned ViewStub
3. A ListView
When I…

Forset1
- 117
- 8
2
votes
1 answer
How to set a typeface to menu items in overflow menu on toolbar
I want to change the default typeface of the items of the overflow menu and set a custom typeface.
I tried adding a Factory to the LayoutInflater and within the onCreateView() method I changed the TextView's typeface. But it didn't work. Here is…

chathura
- 3,362
- 6
- 41
- 68