AI2 Component  (Version nb184)
com.google.appinventor.components.runtime.ActivityStarter Class Reference
Inheritance diagram for com.google.appinventor.components.runtime.ActivityStarter:
com.google.appinventor.components.runtime.AndroidNonvisibleComponent com.google.appinventor.components.runtime.ActivityResultListener com.google.appinventor.components.runtime.Component com.google.appinventor.components.runtime.Deleteable com.google.appinventor.components.runtime.Component

Public Member Functions

 ActivityStarter (ComponentContainer container)
 
String Action ()
 
void Action (String action)
 
String ExtraKey ()
 
void ExtraKey (String extraKey)
 
String ExtraValue ()
 
void ExtraValue (String extraValue)
 
String ResultName ()
 
void ResultName (String resultName)
 
String Result ()
 
String DataUri ()
 
void DataUri (String dataUri)
 
String DataType ()
 
void DataType (String dataType)
 
String ActivityPackage ()
 
void ActivityPackage (String activityPackage)
 
String ActivityClass ()
 
void ActivityClass (String activityClass)
 
void AfterActivity (String result)
 
void ActivityCanceled ()
 
String ResultType ()
 
String ResultUri ()
 
void Extras (YailList pairs)
 
YailList Extras ()
 
String ResolveActivity ()
 
void StartActivity ()
 
void resultReturned (int requestCode, int resultCode, Intent data)
 
void ActivityError (String message)
 
void onDelete ()
 
- Public Member Functions inherited from com.google.appinventor.components.runtime.AndroidNonvisibleComponent
HandlesEventDispatching getDispatchDelegate ()
 

Additional Inherited Members

- Static Public Attributes inherited from com.google.appinventor.components.runtime.Component
static final String ASSET_DIRECTORY = "component"
 
static final int ALIGNMENT_NORMAL = 0
 
static final int ALIGNMENT_CENTER = 1
 
static final int ALIGNMENT_OPPOSITE = 2
 
static final int ACCELEROMETER_SENSITIVITY_WEAK = 1
 
static final int ACCELEROMETER_SENSITIVITY_MODERATE = 2
 
static final int ACCELEROMETER_SENSITIVITY_STRONG = 3
 
static final int BUTTON_SHAPE_DEFAULT = 0
 
static final int BUTTON_SHAPE_ROUNDED = 1
 
static final int BUTTON_SHAPE_RECT = 2
 
static final int BUTTON_SHAPE_OVAL = 3
 
static final int COLOR_NONE = 0x00FFFFFF
 
static final int COLOR_BLACK = 0xFF000000
 
static final int COLOR_BLUE = 0xFF0000FF
 
static final int COLOR_CYAN = 0xFF00FFFF
 
static final int COLOR_DKGRAY = 0xFF444444
 
static final int COLOR_GRAY = 0xFF888888
 
static final int COLOR_GREEN = 0xFF00FF00
 
static final int COLOR_LTGRAY = 0xFFCCCCCC
 
static final int COLOR_MAGENTA = 0xFFFF00FF
 
static final int COLOR_ORANGE = 0xFFFFC800
 
static final int COLOR_PINK = 0xFFFFAFAF
 
static final int COLOR_RED = 0xFFFF0000
 
static final int COLOR_WHITE = 0xFFFFFFFF
 
static final int COLOR_YELLOW = 0xFFFFFF00
 
static final int COLOR_DEFAULT = 0x00000000
 
static final String DEFAULT_VALUE_COLOR_NONE = "&H00FFFFFF"
 
static final String DEFAULT_VALUE_COLOR_BLACK = "&HFF000000"
 
static final String DEFAULT_VALUE_COLOR_BLUE = "&HFF0000FF"
 
static final String DEFAULT_VALUE_COLOR_CYAN = "&HFF00FFFF"
 
static final String DEFAULT_VALUE_COLOR_DKGRAY = "&HFF444444"
 
static final String DEFAULT_VALUE_COLOR_GRAY = "&HFF888888"
 
static final String DEFAULT_VALUE_COLOR_GREEN = "&HFF00FF00"
 
static final String DEFAULT_VALUE_COLOR_LTGRAY = "&HFFCCCCCC"
 
static final String DEFAULT_VALUE_COLOR_MAGENTA = "&HFFFF00FF"
 
static final String DEFAULT_VALUE_COLOR_ORANGE = "&HFFFFC800"
 
static final String DEFAULT_VALUE_COLOR_PINK = "&HFFFFAFAF"
 
static final String DEFAULT_VALUE_COLOR_RED = "&HFFFF0000"
 
static final String DEFAULT_VALUE_COLOR_WHITE = "&HFFFFFFFF"
 
static final String DEFAULT_VALUE_COLOR_YELLOW = "&HFFFFFF00"
 
static final String DEFAULT_VALUE_COLOR_DEFAULT = "&H00000000"
 
static final float FONT_DEFAULT_SIZE = 14
 
static final int LAYOUT_ORIENTATION_HORIZONTAL = ComponentConstants.LAYOUT_ORIENTATION_HORIZONTAL
 
static final int LAYOUT_ORIENTATION_VERTICAL = ComponentConstants.LAYOUT_ORIENTATION_VERTICAL
 
static final int SCALING_SCALE_PROPORTIONALLY = 0
 
static final int SCALING_SCALE_TO_FIT = 1
 
static final int TYPEFACE_DEFAULT = 0
 
static final int TYPEFACE_SANSSERIF = 1
 
static final int TYPEFACE_SERIF = 2
 
static final int TYPEFACE_MONOSPACE = 3
 
static final int LENGTH_PREFERRED = -1
 
static final int LENGTH_FILL_PARENT = -2
 
static final int LENGTH_UNKNOWN = -3
 
static final int LENGTH_PERCENT_TAG = -1000
 
static final int TOAST_LENGTH_SHORT = 0
 
static final int TOAST_LENGTH_LONG = 1
 
static final int DIRECTION_NORTH = 1
 
static final int DIRECTION_NORTHEAST = 2
 
static final int DIRECTION_EAST = 3
 
static final int DIRECTION_SOUTHEAST = 4
 
static final int DIRECTION_SOUTH = -1
 
static final int DIRECTION_SOUTHWEST = -2
 
static final int DIRECTION_WEST = -3
 
static final int DIRECTION_NORTHWEST = -4
 
static final int DIRECTION_NONE = 0
 
static final int DIRECTION_MIN = -4
 
static final int DIRECTION_MAX = 4
 
static float SLIDER_MIN_VALUE = 10
 
static float SLIDER_MAX_VALUE = 50
 
static float SLIDER_THUMB_VALUE = (SLIDER_MIN_VALUE + SLIDER_MAX_VALUE) / 2.0f
 
static final String DEFAULT_VALUE_TEXT_TO_SPEECH_COUNTRY = ""
 
static final String DEFAULT_VALUE_TEXT_TO_SPEECH_LANGUAGE = ""
 
- Protected Member Functions inherited from com.google.appinventor.components.runtime.AndroidNonvisibleComponent
 AndroidNonvisibleComponent (Form form)
 
- Protected Attributes inherited from com.google.appinventor.components.runtime.AndroidNonvisibleComponent
final Form form
 

Detailed Description

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 your ActivityStarter 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:
Author
markf.nosp@m.@goo.nosp@m.gle.c.nosp@m.om (Mark Friedman)

Definition at line 138 of file ActivityStarter.java.

Constructor & Destructor Documentation

◆ ActivityStarter()

com.google.appinventor.components.runtime.ActivityStarter.ActivityStarter ( ComponentContainer  container)

Creates a new ActivityStarter component.

Parameters
containercontainer, kept for access to form and context

Definition at line 162 of file ActivityStarter.java.

Member Function Documentation

◆ Action() [1/2]

String com.google.appinventor.components.runtime.ActivityStarter.Action ( )

Returns the action that will be used to start the activity.

Definition at line 183 of file ActivityStarter.java.

◆ Action() [2/2]

void com.google.appinventor.components.runtime.ActivityStarter.Action ( String  action)

Specifies the action that will be used to start the activity.

Definition at line 193 of file ActivityStarter.java.

◆ ActivityCanceled()

void com.google.appinventor.components.runtime.ActivityStarter.ActivityCanceled ( )

Event raised if this `ActivityStarter returns because the activity was canceled.

Definition at line 394 of file ActivityStarter.java.

◆ ActivityClass() [1/2]

String com.google.appinventor.components.runtime.ActivityStarter.ActivityClass ( )

Returns the class part of the specific component that will be started.

Definition at line 366 of file ActivityStarter.java.

◆ ActivityClass() [2/2]

void com.google.appinventor.components.runtime.ActivityStarter.ActivityClass ( String  activityClass)

Specifies the class part of the specific component that will be started.

Definition at line 376 of file ActivityStarter.java.

◆ ActivityError()

void com.google.appinventor.components.runtime.ActivityStarter.ActivityError ( String  message)

Definition at line 589 of file ActivityStarter.java.

◆ ActivityPackage() [1/2]

String com.google.appinventor.components.runtime.ActivityStarter.ActivityPackage ( )

Returns the package part of the specific component that will be started.

Definition at line 347 of file ActivityStarter.java.

◆ ActivityPackage() [2/2]

void com.google.appinventor.components.runtime.ActivityStarter.ActivityPackage ( String  activityPackage)

Specifies the package part of the specific component that will be started.

Definition at line 357 of file ActivityStarter.java.

◆ AfterActivity()

void com.google.appinventor.components.runtime.ActivityStarter.AfterActivity ( String  result)

Event raised after this ActivityStarter returns.

Parameters
resultThe result returned by the activity

Definition at line 385 of file ActivityStarter.java.

◆ DataType() [1/2]

String com.google.appinventor.components.runtime.ActivityStarter.DataType ( )

Returns the MIME type to pass to the activity.

Definition at line 328 of file ActivityStarter.java.

◆ DataType() [2/2]

void com.google.appinventor.components.runtime.ActivityStarter.DataType ( String  dataType)

Specifies the MIME type to pass to the activity.

Definition at line 338 of file ActivityStarter.java.

◆ DataUri() [1/2]

String com.google.appinventor.components.runtime.ActivityStarter.DataUri ( )

Returns the data URI that will be used to start the activity.

Definition at line 309 of file ActivityStarter.java.

◆ DataUri() [2/2]

void com.google.appinventor.components.runtime.ActivityStarter.DataUri ( String  dataUri)

Specifies the data URI that will be used to start the activity.

Definition at line 319 of file ActivityStarter.java.

◆ ExtraKey() [1/2]

String com.google.appinventor.components.runtime.ActivityStarter.ExtraKey ( )

Returns the extra key that will be passed to the activity. Obsolete. Should use Extras instead

Definition at line 220 of file ActivityStarter.java.

◆ ExtraKey() [2/2]

void com.google.appinventor.components.runtime.ActivityStarter.ExtraKey ( String  extraKey)

Specifies the extra key that will be passed to the activity. Obsolete. Should use Extras instead

Definition at line 231 of file ActivityStarter.java.

◆ Extras() [1/2]

YailList com.google.appinventor.components.runtime.ActivityStarter.Extras ( )

Returns the list of key-value pairs that will be passed as extra data to the activity.

Definition at line 448 of file ActivityStarter.java.

◆ Extras() [2/2]

void com.google.appinventor.components.runtime.ActivityStarter.Extras ( YailList  pairs)

Specifies the list of key-value pairs that will be passed as extra data to the activity.

Definition at line 432 of file ActivityStarter.java.

◆ ExtraValue() [1/2]

String com.google.appinventor.components.runtime.ActivityStarter.ExtraValue ( )

Returns the extra value that will be passed to the activity. Obsolete. Should use Extras instead

Definition at line 244 of file ActivityStarter.java.

◆ ExtraValue() [2/2]

void com.google.appinventor.components.runtime.ActivityStarter.ExtraValue ( String  extraValue)

Specifies the extra value that will be passed to the activity. Obsolete. Should use Extras instead

Definition at line 255 of file ActivityStarter.java.

◆ onDelete()

void com.google.appinventor.components.runtime.ActivityStarter.onDelete ( )

◆ ResolveActivity()

String com.google.appinventor.components.runtime.ActivityStarter.ResolveActivity ( )

Returns the name of the activity that corresponds to this ActivityStarter, or an empty string if no corresponding activity can be found.

Definition at line 459 of file ActivityStarter.java.

◆ Result()

String com.google.appinventor.components.runtime.ActivityStarter.Result ( )

Returns the result from the activity.

Definition at line 300 of file ActivityStarter.java.

◆ ResultName() [1/2]

String com.google.appinventor.components.runtime.ActivityStarter.ResultName ( )

Returns the name that will be used to retrieve a result from the activity.

Definition at line 280 of file ActivityStarter.java.

◆ ResultName() [2/2]

void com.google.appinventor.components.runtime.ActivityStarter.ResultName ( String  resultName)

Specifies the name that will be used to retrieve a result from the activity.

Definition at line 291 of file ActivityStarter.java.

◆ resultReturned()

void com.google.appinventor.components.runtime.ActivityStarter.resultReturned ( int  requestCode,
int  resultCode,
Intent  data 
)

The callback method used to report Activity results back to the caller.

Parameters
requestCodethe originally passed in request code. Used to identify the call.
resultCodethe returned result code: android.app.Activity#RESULT_OK or android.app.Activity#RESULT_CANCELED
datathe returned data, encapsulated as an Intent.

Implements com.google.appinventor.components.runtime.ActivityResultListener.

Definition at line 567 of file ActivityStarter.java.

◆ ResultType()

String com.google.appinventor.components.runtime.ActivityStarter.ResultType ( )

Returns the MIME type from the activity.

Definition at line 403 of file ActivityStarter.java.

◆ ResultUri()

String com.google.appinventor.components.runtime.ActivityStarter.ResultUri ( )

Returns the URI from the activity.

Definition at line 418 of file ActivityStarter.java.

◆ StartActivity()

void com.google.appinventor.components.runtime.ActivityStarter.StartActivity ( )

Start the activity corresponding to this ActivityStarter.

Definition at line 473 of file ActivityStarter.java.


The documentation for this class was generated from the following file: