Instantiates a layout XML file into its corresponding View objects
Questions tagged [android-inflate]
651 questions
3
votes
0 answers
Is View.post () harmless in reality?
There are a lot of tips on Stackoverflow on how to wait the moment when View is inflated and measured. Most of them boil down to need to use View.post () or OnGlobalLayoutListener. In my custom views I use the onSizeChanged () method, in which I get…

badadin
- 507
- 1
- 5
- 18
3
votes
1 answer
Where to initiate views in Fragment? onViewCreated or onActivityCreated
So where is the best place to initiate views in a fragment? We know that we should only inflate a layout inside onCreate() and not initiate views, like setting listeners.
You should inflate your layout in onCreateView but shouldn't initialize other…

Reza Bigdeli
- 1,142
- 1
- 12
- 25
3
votes
2 answers
Webview not loading when inflated
I am working on an app with a navigation drawer that can show several screens. These pages are all shown within the same Activity though by inflating them into a wrapper.

Rittel
- 579
- 5
- 21
3
votes
1 answer
android How to show copy and paste context view in edittext in service window
I create popup window in service like this
public class ChatService extends Service {
WindowManager mWindowMgr;
WindowManager.LayoutParams mWinMgrParam;
View mView;
@Override
public void onCreate()
{
LayoutInflater…

Ronaldo Robert
- 31
- 2
3
votes
3 answers
Android Fragment what container is it in onCreateView() method
I wonder what is container parameter in onCreateView(), cause when i inflate view to that container it make me wonder what viewGroup is this,is it a viewGroup from the activity that we will add a fragment to ? if it is true then why we need to…

Tú Anh Dư
- 135
- 1
- 10
3
votes
5 answers
Add space between each item layout in inflate layout android
I do inflate layout. I want give spacing between each item in layout. Like the image below
This is my main code in xml. The parent layout

MAS. John
- 582
- 6
- 22
3
votes
2 answers
Android: draw xml Layout on canvas
I have a custom PrintDocumentAdapter and draw pages on my own, so I should draw xml layout on the page canvas:
private void drawPage(PdfDocument.Page page, List

Mneckoee
- 2,802
- 6
- 23
- 34
3
votes
0 answers
Can't inflate subclassed DialogPreference
Ok, so I'm trying to inflate a DialogPreference in a PreferenceFragment which is nested in an AppCompatActivity. Whenever I try to go to the Activity hosting said PreferenceFragment, this error occurs.
01-14 09:40:37.002 29689-29689/?…

user4442318
- 71
- 1
- 8
3
votes
2 answers
Reuse a inflated view, without inflating more than once
i want to reuse an inflated view just the same way a listView adapter does with convertView. Ive been lurking on the source code of adapters with no luck.
I need to add dinamically views depending on data to a recyclerItemView, now im inflating as…

marcos E.
- 477
- 4
- 11
3
votes
4 answers
Trying to inflate different views for each row of a list view inside getting this (android.view.InflateException: Binary XML..)
(I can provide any other info if you want)
I am getting this error when I try to set separate layout for each row in a ListView. I have a custom adapter extended from the BaseAdapter which implements View.OnClickListener()
I will only give the…

Nyob
- 416
- 1
- 3
- 14
3
votes
1 answer
StackOverflowError when inflating custom view which contains its own views
I am having a Fragment, where I inflate "fragment_board.xml":

Oliver Hausler
- 4,900
- 4
- 35
- 70
3
votes
1 answer
android.view.InflateException: Binary XML file line #45: Error inflating class fragment
Use eclipse.
I want use google map on my app.
when i run app on genymotion emulator logcut show error :android.view.InflateException: Binary XML file line #45: Error inflating class fragment.
I add google-play-services_lib in eclipse and add it in…

Fouad
- 131
- 1
- 11
3
votes
0 answers
LayoutInflater : Error inflating class
Below is my crashing log.
The crash is happening when I select some text in a textview. Unfortunately this log does not contain any references to my program.
Any ideas to debug it?
Also the final line is not a typo, the log just ends there. With…

Diolor
- 13,181
- 30
- 111
- 179
3
votes
0 answers
Mapfragment InflateException and duplicate ID
I a have a drawer layout that displays different fragments. When I change fragments everything is okay however if I try to access my mapfragment twice it displays the following errors:
04-26 22:55:28.816: E/AndroidRuntime(27576): FATAL EXCEPTION:…

Estarossa
- 585
- 4
- 21
3
votes
3 answers
How to use inflater method within the fragment
Hi I am working with android.I had tried to inflate a layout into the fragment, but it shows error in the code "method getLayoutInflater() is undefined for the class". how can I access layout within the fragments ??? please help me I am new to…
user3197109