[Solved] XML to Java code in Android [closed]

[ad_1]

You can inflate its views by doing:

LayoutInflater inflater = (LayoutInflater)context.getSystemService
  (Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(...);

Alternatively, you can simply create a view like

final LinearLayout l = [...]
//add stuff
l.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
//etc...

[ad_2]

solved XML to Java code in Android [closed]