ActivityStarter
Definition
A component that can launch an activity using the StartActivity method.
Activities that can be launched include:
- Starting another App Inventor for Android app. To do so, first find out the class of the other application by downloading the source code and using a file explorer or unzip utility to find a file named “youngandroidproject/project.properties”. The first line of the file will start with “main=” and be followed by the class name; for example,
main=com.gmail.Bitdiddle.Ben.HelloPurr.Screen1
. (The first components indicate that it was created by Ben.Bitdiddle@gmail.com.) To make yourActivityStarter
launch this application, set the following properties:ActivityPackage
to the class name, dropping the last component (for example,com.gmail.Bitdiddle.Ben.HelloPurr
)ActivityClass
to the entire class name (for example,com.gmail.Bitdiddle.Ben.HelloPurr.Screen1
)
- Starting the camera application by setting the following properties:
Action
:android.intent.action.MAIN
ActivityPackage
:com.android.camera
ActivityClass
:com.android.camera.Camera
- Performing web search. Assuming the term you want to search for is “vampire” (feel free to substitute your own choice), set the properties to:
Action
:android.intent.action.WEB_SEARCH
ExtraKey
:query
ExtraValue
:vampire
ActivityPackage
:com.google.android.providers.enhancedgooglesearch
ActivityClass
:com.google.android.providers.enhancedgooglesearch.Launcher
- Opening a browser to a specified web page. Assuming the page you want to go to is “www.facebook.com” (feel free to substitute your own choice), set the properties to:
Action
:android.intent.action.VIEW
DataUri
:http://www.facebook.com
Properties
- Action
- Specifies the action that will be used to start the activity.
- ActivityClass
- Specifies the class part of the specific component that will be started.
- ActivityPackage
- Specifies the package part of the specific component that will be started.
- DataType
- Specifies the MIME type to pass to the activity.
- DataUri
- Specifies the data URI that will be used to start the activity.
- ExtraKey
- Specifies the extra key that will be passed to the activity. Obsolete. Should use Extras instead
- ExtraValue
- Specifies the extra value that will be passed to the activity. Obsolete. Should use Extras instead
- Extras
- Returns the list of key-value pairs that will be passed as extra data to the activity.
- Result
- Returns the result from the activity.
- ResultName
- Specifies the name that will be used to retrieve a result from the activity.
- ResultType
- Returns the MIME type from the activity.
- ResultUri
- Returns the URI from the activity.