Questions tagged [android-include]
41 questions
0
votes
1 answer
Android: Data Binding: providing values in included layouts
I have the following layout - text_input_layout.xml:
…

Sunny
- 7,444
- 22
- 63
- 104
0
votes
0 answers
How can I dynamically change the background of the toolbar?
I have a toolbar and I want to change the background image when switching between this toolbar in activity. In addition, the toolbar is fixed and contained in an < include >.
layout_toolbar.xml

fatih
- 67
- 1
- 12
0
votes
1 answer
Android: Pass different content from viewmodel to different include-tags
In my task app I want to use databinding for the task overview. I've grouped tasks in three categories: overdue, today and future.
My task_overview.xml defines the following viewmodel (which contains three arraylists with the different tasks)…

jennymo
- 1,450
- 1
- 18
- 43
0
votes
0 answers
Android passing a enum variable from one xml to an included xml file that consequently sends it to code
I'm trying to reuse a xml file which I include in my main_layout.xml. In the code of my activity, I check for a variable "positionType" and depending on that variable I run different codes.
PositionType.java
public enum PositionType {
play_top,…

Eduardo Pinheiro
- 3,409
- 3
- 30
- 39
0
votes
0 answers
child view in percent relative layout visibility change
my aim is to change the visibility of the included layouts in each tablerow
based on a single if condition.
i changed the code onResume() method. but the second tablerow is not visible to me. even i printed the logs. i got View.Visible only.

Sriram Balaji
- 3
- 2
0
votes
0 answers
android - using different ids for 'include' tag and the included toolbar does not work
I am just trying to use the android.support.v7.widget.Toolbar in a very simple app. The Activity file contains:
package com.example.istiaqueahmed.toolbarapp;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import…

Istiaque Ahmed
- 6,072
- 24
- 75
- 141
0
votes
1 answer
Access all children elements of included layouts from main layout
I have a activity_main layout which looks like the following layout:

Heisenberg
- 1,500
- 3
- 18
- 35
0
votes
2 answers
What is Phone Window Decor View?
I tried getting the root view of a layout I'm including (include tag). Instead of the initial Relative Layout that I used, it returned Phone Window Decor View. What is it? How come it's not under the relative layout?
Structure below:

Kim Montano
- 2,185
- 4
- 26
- 39
0
votes
2 answers
Android ViewPager not Showing
I am trying to make a little app to try out some things for a bigger app I am developing. I want to add a viewpager that displays four images, I developed this viewpager alone and it worked, but when I tried to add it to my other app (with just a…

mrRSA
- 3
- 3
-2
votes
1 answer
Getting a View with a duplicate id from a layout
I would like to display the following five times

Quillion
- 6,346
- 11
- 60
- 97
-2
votes
3 answers
Android - how to access buttons inside include layout
I created header.xml and include thus in Main.xml and Menu.xml.
In header.xml i have a button.
Header.xml

Hani Mehdi
- 187
- 4
- 9