[android-developers] Java to XML

2012-08-06 Thread nybras
New to Android Development and was wondering if there was some way of taking 
the users input to create an activity? For example say the user is going 
through the process of setting up a profile of themself. One of the questions 
is "how many pets do you have?". The user inputs "4" and then clicks the 'Next' 
button (which opens the next activity).

How would I take the users input of "4" to create four editText objects in the 
next activity so that the user can now input the name's of his/her's pets?

I'm an ok-ish programmer (have never touched XML before though) so you don't 
need to go into much detail I just don't know how I would access this variable 
to create the four editText objects. From what I've found out you can't add 
strings to the resources at run-time nor can even edit/append files in 
resources.

I was thinking of writing an XML file from java and making the activity 
(obviously written in XML) read the XML file if that's even possible? Can XML 
files read XML files?

-- 
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] Java to XML

2012-08-06 Thread dnkoutso
Pass the 4 as an intent extra in your next activity.

 Have a container layout in your next activity (probably linear layout with 
vertical orientation) then onCreate read the intent extra and loop through and 
programmatically create EditText views. Call addView() from your container 
layout.

Sent from my Galaxy Nexus

-- 
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