Instantiates a layout XML file into its corresponding View objects
Questions tagged [android-inflate]
651 questions
1
vote
1 answer
Set OnTouchListener to multiple button contained on a xml inflated
I need to Inflate this layout 15 times on a main layout activity (arranged in 3 rows by 5 columns), and set OnTouchListener for each Button padButton istances, wath is the best way to do it?? I try to inflate layout but not have idea to set listener…

kosma822
- 183
- 1
- 2
- 7
1
vote
1 answer
Keeping Only One radio Button Checked In an TableRow Inflater?
I have been trying to keep only one of the radio buttons checked but every time the user is able to select multiple radio buttons.
How can I keep just a single or the current selected radio button checked?
I basically have a TableLayout which has a…

beerBear
- 969
- 2
- 17
- 41
1
vote
2 answers
Call a function after ListView has called getView()
Is there any way that you can call a function after its getView method has been called. For example, i would like to be able to hide/show various widgets based on the size of them. For this i need to be able to query the size of the widget in the…

Paul Thompson
- 3,290
- 2
- 31
- 39
1
vote
1 answer
Prevent double click when Inflating View android
I was changing view when click button using Layoutinflater.The button have located in the same position in all the screen.
If i click button it change the view only once.If i double click the button it change the view twice.It means click…

codewithdk
- 1,290
- 1
- 10
- 23
1
vote
2 answers
What happens behind the scenes when an xml is "inflated"?
For example When we write the code
View view = inflater.inflate(R.layout.main_activity, null);
What does the Android system do?

Gaurav Agarwal
- 18,754
- 29
- 105
- 166
1
vote
1 answer
Robolectric fails to inflate Views in DialogFragment
I'm trying to test the following method of a DialogFragment:
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
View rootView = View.inflate(getActivity(), R.layout.fragment_fileproperties_layout, null);
…

Egor
- 39,695
- 10
- 113
- 130
1
vote
2 answers
How to get Action Mode working with a ListView
I'm trying to get a contextual menu using the Action Mode where I can select an item in a ListView by long-clicking on it. I created a MultiChoiceListener according to this reference and made a ItemLongClickListener wich sets an item as checked…

NiPfi
- 1,710
- 3
- 18
- 28
1
vote
1 answer
displaying a different layout in details fragment
I have an fragment layout in android. The left pane has an listfragment that has list of options and right side pane has details or forms specific to the item selected from left side's listfragment pane. Now Till this i have done and its working But…

user1661935
- 11
- 1
1
vote
1 answer
Android inflating multiple spinner causes strange selection behavior
in the program I inflate several Spinners and add them to a layout. For each spinner I make an individual selection. This works fine if the Activity is created as usual - so every spinner gets his own selection. If the activity is created due to a…

Anthea
- 3,741
- 5
- 40
- 64
1
vote
1 answer
Inflating UI from XML
I have a very basic program which displays a standard Textview and a extended Textview. The extended ones are to be inflated into the main Layout. Now every time I add a new extended textview, it appears fine however I also want some gap between…

user1455536
- 27
- 3
1
vote
3 answers
How to get OnClick Event on inflated view
I have inflated view from xml and added it to layout:
View header = LayoutInflater.from(this).inflate(R.layout.lenta_parent_item,(FrameLayout)findViewById(R.id.frameContent), false);
header.setOnClickListener(new OnClickListener() {
public…

Homo Incognito
- 368
- 1
- 3
- 12
1
vote
1 answer
How to solve this error in tab menu with database?
In my app I have tab menu : Add tab,View tab.
in Add tab: I add data to database
in View tab: I select data from database into listview
now I have problem: when I add a data from add tab and switch into viewtab I can't view last adding into…

SWE
- 131
- 2
- 7
- 20
1
vote
2 answers
ViewHolder implementation and use
I've implemented a listview (where each item is a buttom) and now I want to improve its efficiency by using a ViewHolder. Here is my problem, I dont know where must I override these button's OnClick methods.
This is the getView of my…

dnaranjo
- 3,647
- 3
- 27
- 41
0
votes
2 answers
0
votes
1 answer
Android - android.view.InflateException: Error inflating class
I'm trying to implement android-viewflow application developed by Patrik Akerfeldt.
The source code is here: https://github.com/pakerfeldt/android-viewflow
I've added "view-flow" folder as a library project and referenced it in my application. When…

alprncekol
- 5
- 3