Questions tagged [android-inflate]

Instantiates a layout XML file into its corresponding View objects

651 questions
1
vote
1 answer

Android Fragment not inflating after transaction

I've been trying to inflate a simple contentFragment after clicking on the tab from my navigation drawer. Here is my CentralView class that contains the attempt to inflate the Fragment import android.support.v7.app.AppCompatActivity; import…
David Parks
  • 77
  • 1
  • 11
1
vote
6 answers

How I can pass class object between two activities?

I have a class Books.java that implements a list of Book.java, and in MainActivity.java i fill the object library with books. I want send the object library from MainActivity.java to ListActivity.java but not works with i.putExtra. How I can do…
Joan Triay
  • 1,518
  • 6
  • 20
  • 35
1
vote
0 answers

How can I call Fragment's class from viewPager?

I don't have problems with appearance but when begin it, it shows nothing. I think only inflate the layout but I want call the class of my Fragments where I do all everything class PlaceholderFragment: public View onCreateView(LayoutInflater…
1
vote
1 answer

Android inflate causes java.lang.OutOfMemoryError occaionally

The code is like the following in onResume of an activity: for (int i = 0; i < 4; i++) { LayoutInflater.from(this).inflate(R.layout.image_view, gridLayout); ... } The component of Layout image_view related to the crash is the…
Hong
  • 17,643
  • 21
  • 81
  • 142
1
vote
1 answer

Inflation of View Failing

I've been trying to programatically inflate a linearlayout of buttons using a loop, but it doesn't show up in the ui at all. The array gets populated, however. My button xml:
1
vote
0 answers

Making sense of LayoutInflater revisited

There is already a question here with title Making sense of LayoutInflater, which has very good explanation by @andig which is accepted. But one thing bothering me is a behavior of addView when no parent is specified during inflating and no…
Rajen Raiyarela
  • 5,526
  • 4
  • 21
  • 41
1
vote
1 answer

Android: Avoiding "complete action using" when there's an app on the phone with the same pkg name as the library

I'm using ZXing, the barcode scanning library. It's also an app that you can download and install independantly, but I am currently using it as a library to integrate into my app. I want to be able to invoke that library and bring up one of its…
D Mw
  • 21
  • 5
1
vote
1 answer

viewPager background color effect on my Image

I don't knew how can say my problem, I have a xml file with ViewPager inside a CoordinatorLayout, in another xml layout(Fragment Layout) I have ImageView, I inflate my fragment layout and show it in viewpager, the problem is here: when I change(or…
1
vote
1 answer

How to access views from the programatically inflated layouts?

I have an activity in which I have inflated another layout. OnClick of next destination I am getting inflated a new layout. Now I want to remove the inflated layout. So I want to access the linear layout of remove from inside inflated layout. How…
user5669913
1
vote
1 answer

Why does an InflateException (Caused by ClassNotFoundException) occur?

I am developing a metronome app. I am doing the part where I let people to select the tempo. And looks something like this: Tempo: <-- TextView 90 <-- EditText --O------ <-- SeekBar But then I changed my mind and changed the…
Sweeper
  • 213,210
  • 22
  • 193
  • 313
1
vote
1 answer

Android inflate view multiple time with custom View

I created a custom class to quickly create View object (basically it's just a question displayed). Exemple : Title : Weather Message : How is the weather today? So here is my custom class extending View : public class Question extends View { …
1
vote
1 answer

inflateMenu doesn't work on Toolbar inside CollapsingToolbarLayout

I'm trying to assign a menu to a Toolbar which is inside a CollapsingToolbarLayout. These are the xml and Java codes. The problem is that inflateMenu simply does nothing.
1
vote
1 answer

How to change Android toolbar view?

I'm working with the new android toolbar. /* Jump into, after the user clicks on a listview item */ private void toogleToolbar() { if (isStandardToolbar) customToolbar(); else originalToolbar(); isStandardToolbar =…
1
vote
0 answers

Android LayoutInflater.inflate adds view to the root parent, and not the parent passed in

Lets say I have a layout with a hierarchy ViewGroups as such A > B > C Where A contains B, and B contains C. I want to inflate a small partial layout that is supposed to go inside C, so inside my activity I do…
Siavash
  • 7,583
  • 13
  • 49
  • 69
1
vote
1 answer

Getting java.lang.RuntimeException while try to add views dynamically to linear layout android

I have the following crash when try to add view to linear layout in android. java.lang.RuntimeException: Unable to start activity ComponentInfo{com.q8car.andriod.activity/com.technivance.q8car.view.FilterItemsActivity}:…