I have found lots of question here regarding adding LinearLayout dynamically. I haven't found any reference or any tutorial or books suggested where I could know complete details of the and steps to add a LinearLayout dynamically.
LinearLayout parentLayout = (LinearLayout) findViewById(R.id.master);
LinearLayout Linear1 = new LinearLayout(this);
Linear1.setOrientation(LinearLayout.HORIZONTAL);
Linear1.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT));
parentLayout.addView(Linear1);
This is the code snippet I am using for adding a Layout. The problem is that the min api required is 11. I have designed my app targeting api 10. So its very bad news for me. Please tell me is there any other way to add LinearLayout dynamically for the lower apis?
Error Message: Call requires API level 11 (current min is 8): new android.app.ActionBar.LayoutParams