I've different layout. Some created by xml. Some others dynamically via code. When I am on xml I can set width or height with "wrap_content" value. How to get the same result dynamically? This is the snippet of my dynamic TextView. I need to remove "final int width = 440;" and get same value of "wrap_content". How?
final int width = 440;
final int height = textViewHeight;
final int top = getNewTop(height);
FrameLayout.LayoutParams layoutParams;
layoutParams = getLayoutParams(width, height, top);
TextView textView;
textView = new TextView(_registerNewMealActivity);
textView.setText(text);
textView.setLayoutParams(layoutParams);
_frameLayout.addView(textView);