Wednesday, February 3, 2010

Re: [android-developers] How to add some button dynamicly after setContentView

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 <chenjihz001@gmail.com>
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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment