RSS

Passing multiple keys & values to activities

28 Apr

Android provides ability to invoke other Activities  (apps e.g. Camera) and pass in data in form of Key/Value pairs where Key-value pairs  carry additional information required to accomplish the requested action. For example, if using SDK, the following syntax is used to invoke ActivityTwo, passing it 2 key/value pairs.

Intent i = new Intent(this, ActivityTwo.class);
i.putExtra("Value1", "This value one for ActivityTwo ");
i.putExtra("Value2", "This value two ActivityTwo");
startActivity(i);

App Inventor, using ActivityStarter, allows you to accomplish the same. However, it is limited to passing only one key/value pair. For example to add a contact into contact list, the following blocks can be used:

image

The ActivityStarted in AiLiveComplete has been extended allowing you to pass in multiple key/value pairs. For example, blocks below show you how to invoke the Contacts and add in new contact and pass in multiple values:

imageThe above approach for passing multiple key/value pairs can be used for passing parameters to any other activity.

Interested in AiLiveComplete? please see HERE for details and more information.
 

Mobile App Development

 
2 Comments

Posted by on April 28, 2014 in Uncategorized

 

2 responses to “Passing multiple keys & values to activities

  1. kevin r

    April 1, 2015 at 10:17 am

    i cant find that option. where is it?

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: