Hi, everyone:

I'm trying to create a method that will post data to a web form. The
method will accept two parameters: 1) a url; and 2) a collection of
keys and values representing fields and values on the form. The
problem is that the fields and values are arbitrary - the names of the
fields, even the number of fields are unknown.

My first thought was, "hey, just put the fields in a ContentValues
variable." So, I'd have something like this:

Code:
ContentValues myFields = new ContentValues();
myFields.put("form_field_1", "some value");
myFields.put("form_field_2", "some other value");

myWebFormMethod(myURL, myFields);


However, I don't know how to "loop" through a ContentValues variable
and parse the "key" and "value." All of the examples I've found so far
expect that you know the names of the keys in advance (which, with my
method, I won't). Any ideas? Thanks in advance!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to