Questions tagged [android-inflate]

Instantiates a layout XML file into its corresponding View objects

651 questions
3
votes
2 answers

Android - png resource converted to a ColorDrawable on android < 4.0

According to documentation here, A png resource should be converted to a BitmapDrawable. However I'm observing a strange behavior wherein a png file which has only black pixels in it is resulting in a crash because of ClassCastException (wrapped in…
3
votes
5 answers

Infalting Relative Layout Android

I want to inflate Relative Layout in a Relative Layout .But it is inflating it only one time after that it is not inflating please help me what is the problem in my code. Activity Code LayoutInflater inflater = (LayoutInflater)…
Pooja Dubey
  • 683
  • 2
  • 14
  • 34
3
votes
0 answers

Android performance issue with inflating a custom view

I ave created a custom view of a month tile grid that is displayed for a particular year. it holds 12 date tiles representing each month. it looks like this: each tile is inflated using the following XML:
Mortalus
  • 10,574
  • 11
  • 67
  • 117
3
votes
1 answer

Adding an inflating view with an animation

I have a view that I inflate when a use clicks a button, and I want to animate the view to the screen when the button is clicked, I have tried the code below but the view just snaps to the screen instead of animates on to the screen. I am not sure…
kabuto178
  • 3,129
  • 3
  • 40
  • 61
3
votes
1 answer

Rendering Views to View Pager - Optimized Way

In my application I am using the following means to render/generate the views to a view pager. Yes it works fine and as expected. Note :- But here I have seen that this method has to put a lot of effort in terms of Android resources ( associated…
3
votes
2 answers

Merge xml layout programmatically in Android

I have build a layout programmatically in Android (a treeview) and now I'd like to add to the built view a topbar (topbar.xml). So what I need is instead of: setContentView(scroll) Something…
Luigi Tiburzi
  • 4,265
  • 7
  • 32
  • 43
3
votes
1 answer

Method like "instanceof" for custom views in Android?

I inflate some layouts during running of App and store them in a variable of type View.I know that I can set a Tag for view after inflating it and check it to detect it's type,but is there another way to detect it?For example a method like…
hasanghaforian
  • 13,858
  • 11
  • 76
  • 167
3
votes
1 answer

android.view.InflateException error inflating class com.android.internal.widget.ActionBarView

I am new to Android and I am getting many errors, while running my app, in Logcat. 11-26 16:21:42.787: E/AndroidRuntime(1103): FATAL EXCEPTION: main 11-26 16:21:42.787: E/AndroidRuntime(1103): java.lang.RuntimeException: Unable to start activity…
aneela
  • 1,457
  • 3
  • 24
  • 45
3
votes
1 answer

VirtualMachineError in overriding View.layout(...)

Android throws fatal error then I inflating class, which has overridden method: Class MyButton extends Button { .... @Override public void layout(int l, int t, int r, int b) { super.layout(l, t, r, b); } } Doesn't matter if…
3
votes
2 answers

android relative layout background crash

Well' I have a RelativeLayout
Nick
  • 3,205
  • 9
  • 57
  • 108
2
votes
2 answers

What is the difference from inflating an activity and inflating a view in android?

I don't seem to understand if it's possible to inflate (include) an activity into another activity. I know i can inflate a layout xml, this works, but i am wondering if i can inflate an activity. For instance , i have class A that extends Activity…
Gabi Radu
  • 1,107
  • 2
  • 16
  • 35
2
votes
2 answers

TableRow layout inflator not showing data in landscape mode

I had a strange problem. I am creating a table by inflating the table row like this TableLayout table = (TableLayout) findViewById(R.id.tablelay); LayoutInflater inflater = getLayoutInflater(); for (int j = 0; j < limit ; j++) { TableRow row =…
droid kid
  • 7,569
  • 2
  • 32
  • 37
2
votes
2 answers

How to inflate FrameLayout?

I have linear Layout and I want to inflate FrameLayout into it. Do you know, how it can be done? Is it possible? I am still getting errors of No Suitable Method Found For Inflate Thanks Edit: answering myself: LinearLayout ll=(LinearLayout)…
Waypoint
  • 17,283
  • 39
  • 116
  • 170
2
votes
3 answers

How to inflate another view into LinearLayout?

This is my XML with 2 LinearLayouts.
sandalone
  • 41,141
  • 63
  • 222
  • 338
2
votes
1 answer

Cannot hide ViewStub layout

I have layout for no internet connection in my app as ViewStub it should inflated and showing only when internet is disconnected "I have netwrok listener and var isNetworkAvailable as MutableStateFlow that lisent to the network state, the problem is…
Krista
  • 64
  • 7