[android-developers] Re: how to load XML files dynamically
The LayoutInflater has an inflate() method which lets you do this: http://developer.android.com/reference/android/view/LayoutInflater.html On Feb 4, 12:00 pm, Shekhar shekhar...@gmail.com wrote: Hi Folks, I need help on how to load XML file dynamically in the code.I have an activity and for the activity I have 5 xml layout files.I want to load one of the XML file depending on the some logical condition.for e.g switch(i) { case 1: //load XML file 1 break; case 2: //load XML file 2 break; case 3: //load XML file 3 break; } Please help me with some code snippet as i am new to the android Programming. Thanks, Shekhar -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: how to load XML files dynamically
Hi Chaz, Thanks for your prompt reply.I need a sample program where i can see the usuage of inflate method so that it will be easy for me to understand.Appreciate if you could help. Thanks, Shekhar On Feb 4, 5:41 pm, MrChaz mrchazmob...@googlemail.com wrote: The LayoutInflater has an inflate() method which lets you do this:http://developer.android.com/reference/android/view/LayoutInflater.html On Feb 4, 12:00 pm, Shekhar shekhar...@gmail.com wrote: Hi Folks, I need help on how to load XML file dynamically in the code.I have an activity and for the activity I have 5 xml layout files.I want to load one of the XML file depending on the some logical condition.for e.g switch(i) { case 1: //load XML file 1 break; case 2: //load XML file 2 break; case 3: //load XML file 3 break; } Please help me with some code snippet as i am new to the android Programming. Thanks, Shekhar -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: how to load XML files dynamically
On Thu, Feb 4, 2010 at 7:26 AM, Shekhar shekhar...@gmail.com wrote: I need a sample program where i can see the usuage of inflate method so that it will be easy for me to understand No, you need to put some time and effort into doing your own work and then posting back here if you get stuck on specifics. MrChaz already pointed you to the class and function you need to use. Reading the documentation on the function and playing with it for about 5 minutes should be all you need to get going. - TreKing - Chicago transit tracking app for Android-powered devices http://sites.google.com/site/rezmobileapps/treking -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en