Changes
Development Team/Almanac/sugar.activity.activityfactory (view source)
Revision as of 16:08, 31 July 2008
, 16:08, 31 July 2008New page: === How do I start up another sugar activity programmatically? === The sugar.activity.activityfactory package has a convenience function called create() that you can call to start up a ne...
=== How do I start up another sugar activity programmatically? ===
The sugar.activity.activityfactory package has a convenience function called create() that you can call to start up a new instance of a particular activity. You simply need to pass the create() function the service name of the activity you desire. The service name can usually be obtained by looking in the activity.info file of the activity in question.
<pre>
#Start up a new instance of the Web activity.
activityfactory.create('org.laptop.WebActivity')
</pre>
The sugar.activity.activityfactory package has a convenience function called create() that you can call to start up a new instance of a particular activity. You simply need to pass the create() function the service name of the activity you desire. The service name can usually be obtained by looking in the activity.info file of the activity in question.
<pre>
#Start up a new instance of the Web activity.
activityfactory.create('org.laptop.WebActivity')
</pre>