Re: [android-developers] How to add some button dynamicly aftersetContentView
U can use id in xml, use findViewById method to find the layout in your activity, then add a new button in layout with code.
2010-02-04
王心锋
Senior Software Engineer/MDEV Creator
Email: kyowxf2003@gmail.com
Web: http://mdev.cc
Community: http://mdev.cc/dev
Project Wiki:http://mdev.cc/wiki
Tel:0551-2341751
Mobile: +86.13485512230
Address: 7#602 ShuNanTingYuan, WangJiang Road,HeFei City,An Hui Province
Senior Software Engineer/MDEV Creator
Email: kyowxf2003@gmail.com
Web: http://mdev.cc
Community: http://mdev.cc/dev
Project Wiki:http://mdev.cc/wiki
Tel:0551-2341751
Mobile: +86.13485512230
Address: 7#602 ShuNanTingYuan, WangJiang Road,HeFei City,An Hui Province
发件人: chen ji
发送时间: 2010-02-04 11:12:42
收件人: Android Developers
抄送:
主题: [android-developers] How to add some button dynamicly aftersetContentView
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

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home