Yes, you should use
LayoutInflater _inflater = LayoutInflater.from(context);
to relect the layout file into your code
Like:
View itemView = _inflater
.inflate(R.layout.tool_bar_menu_item, parent, false);
then you can add something you want to itemView
I hope this will be help
2010/2/4 chen ji <[email protected]>
> Hi All,
>
> I have use setContentView(R.layout.main) in the onCreate as using XML
> to set my whole layout.
>
> But now I need add some button dynamicly in the code so I think I need
> get the layout of the Activity again.
>
> So need I get the laytout of the activity again?
> If I am right, how to get it?
>
> Thanks very much'
>
> Ji
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
--
Best Regards
Haric
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en