Android Get xml from each class
I need a adapter for getting a UI veiw and putting it to each tab classes.
My target is to put the fixed UI in a xml and i dont want to copy them for each xml. Onl开发者_开发百科y i want to get this view from each class. This is the logo part of my application!
ok... give this a try.... hope this helps
LayoutInflater li = this.getLayoutInflater();
View v = li.inflate(R.layout.neededxml,null);
LinearLayout logoView = new LinearLayout(this);
LinearLayout vgr=(LinearLayotu)li.inflate(R.layout.mainxml,null);
vgr.addView(logoView);
vgr.addView(v);
this.setContentView(vgr);
精彩评论