How to get layout_weight programmatically?

android, layout

Solution

Get the `LinearLayout.LayoutParams` with `getLayoutParams()` on a `View` the parent of which is a `LinearLayout`. The `LayoutParams` object has a `weight` field.

Problem

I have simple question: How to get layout_weight programmatically? I seen many topics, when some Layoute set layout_weight, but how to get it?

Original source