Questions tagged [android-include]
41 questions
1
vote
1 answer
1
vote
1 answer
Changing the TextView in included layout
I am trying to change the text in TextView during the program execution to the data sent from a different activity.
The TextView id="@+id/userName" is in my nav_header_main layout file

xerex09
- 166
- 14
0
votes
1 answer
RadioGroup Android Databinding XML With Include Layouts
I am currently facing an issue with the radio buttons in my app. My app comprises Information Forms which include Radio buttons with other Views and there are multiple forms. When I select option 1 of the first and second radio buttons and select…

Muhammad Yousuf
- 127
- 2
- 16
0
votes
2 answers
how to include same layout multiple times
Hi I have a layout which I want to use multiple times
but when I use include it only appears once, I looked online but could not get an answer
could you suggest what am I doing wrong here please
thanks in advance
R
my common…

BRDroid
- 3,920
- 8
- 65
- 143
0
votes
0 answers
Android Reuse java code for layouts
I'm pretty new to Android Development and swamped by the possibilities.
I have a fragment, in which I reused a layout component (the searchbar). I also want to reuse the (java) code, that handels the logic of this searchbar like OnClickListeners.…

Frederik Klein
- 1
- 2
0
votes
1 answer
ConstraintLayout include positioning issue
Portion of an activity layout included from external layout definition. After including some UI elements lose their original positioning.
Original layout has text positioned to the left:
Included layout centers the same text:
Text elements are…

Andriy
- 707
- 1
- 7
- 16
0
votes
1 answer
Configurations for activity_main.xml must agree on the root element's ID. Missing ID: - layout @+id/drawer_layout: - layout-land
Im using viewbinding, and i get this error when i build
Configurations for activity_main.xml must agree on the root element's ID.
Missing ID:
- layout
@+id/drawer_layout:
- layout-land
It says i need to have two different id for rootview. But i…

sire
- 25
- 5
0
votes
1 answer
error when passing attribute to a layout from included layout
In order to make my app code cleaner, I try to create common xml but I am getting an error like below:
error: activity_login.xml:230: AAPT: error: attribute buttonTitle
In my Login.xml file:

Seb
- 2,929
- 4
- 30
- 73
0
votes
0 answers
include inside nestedscrollview inside constraintlayout with maxheight causes include with variable height to not be expanded in its full height
Following snippet from my layout xml:

Roar Grønmo
- 2,926
- 2
- 24
- 37
0
votes
1 answer
ViewBinding not working for layout included inside RecyclerView item
This is my RecyclerView Item Layout

Vishak A Kamath
- 117
- 14
0
votes
2 answers
layout does not have the right size
I'm creating a layout_banner.xml that is referenced by multiple other layouts, and has a height of 80dp.
layout_banner.xml:

PM4
- 624
- 1
- 5
- 18
0
votes
2 answers
Android -tag adds extra margin to CardView
I'm in the middle of doing a design-focused school project in Android studio (Java code is not the priority) where I wanted to design a workout app of sorts.
However I'm currently having issues with my XML-layouts not displaying as the same way in…

William Larsson
- 25
- 4
0
votes
1 answer
Can't add Buttons with their own layouts to another layout
I need to accomplish the following tasks:
1) each of four buttons is held inside its own Relative or Frame
layout
2) these four layouts with buttons inside them are added to
another bigger layout thru include
tag
3) this bigger layout is…

goran rakitovic
- 9
- 1
0
votes
1 answer
programmatically check if view includes specific layout?
I have a layout section.xml and some other layouts that may include section.xml.
Now suppose I have an inflated layout, for example layout.xml, and I want to know does it include section.xml or not?
I can loop through all children of layout.xml, but…

hasanghaforian
- 13,858
- 11
- 76
- 167
0
votes
1 answer
CoordinatorLayout scrolling does not work while Toolbar is added via
So i have been learning a tutorial to hide tool bar in CoordinatorLayout while i scroll up my view pagers first fragment but toolbar is not moving up or hiding while i scroll up.
The toolbar is added in Coordinator layout using < include layout / >…

Mr.PooP
- 15
- 4