Tuesday, 16 September 2014

Android add or include xml Layout

 
 way-1
 
LinearLayout myLayout = (LinearLayout)findViewById(R.id.linearLayout1);
        View itemInfo1 = getLayoutInflater().inflate(R.layout.item, myLayout, true);
        View itemInfo2 = getLayoutInflater().inflate(R.layout.item, myLayout, true);
        View itemInfo3 = getLayoutInflater().inflate(R.layout.item, myLayout, true);
 
 
 way-2
 
       LayoutInflater inflater = (LayoutInflater)      this.getSystemService(LAYOUT_INFLATER_SERVICE);
 View childLayout = inflater.inflate(R.layout.***************,
 (ViewGroup) findViewById(R.layout.***************));
 layout_daily_diary_content.addView(childLayout);*/
 
 way-3

    LinearLayout linearLayout = (LinearLayout) View.inflate(this,
   R.***********, null);
   layout_content.addView(linearLayout);

No comments:

Post a Comment