Build 1.0_r1(from source)

android.test
Class TestListActivity

java.lang.Object
  extended by android.content.Context
      extended by android.content.ContextWrapper
          extended by android.view.ContextThemeWrapper
              extended by android.app.Activity
                  extended by android.app.ListActivity
                      extended by android.test.TestListActivity
All Implemented Interfaces:
ComponentCallbacks, KeyEvent.Callback, LayoutInflater.Factory, View.OnCreateContextMenuListener, Window.Callback

public abstract class TestListActivity
extends ListActivity

Activity base class to use to implement your application's tests.

Implement the getTestSuite() method to return the name of your test suite class.

See the android.test package documentation (click the more... link) for a full description Not needed for SDK


Field Summary
(package private) static int MODE_GROUP
          "Mode" group in the menu.
(package private)  String mSuite
          Our suite
(package private)  String[] mTests
          Our children tests
static String PERFORMANCE_TESTS
          Supplied in the intent extras if we are running performance tests.
 
Fields inherited from class android.app.ListActivity
mAdapter, mList
 
Fields inherited from class android.app.Activity
DEFAULT_KEYS_DIALER, DEFAULT_KEYS_DISABLE, DEFAULT_KEYS_SEARCH_GLOBAL, DEFAULT_KEYS_SEARCH_LOCAL, DEFAULT_KEYS_SHORTCUT, FOCUSED_STATE_SET, RESULT_CANCELED, RESULT_FIRST_USER, RESULT_OK
 
Fields inherited from class android.content.Context
ACTIVITY_SERVICE, ALARM_SERVICE, AUDIO_SERVICE, BIND_AUTO_CREATE, BIND_DEBUG_UNBIND, BLUETOOTH_SERVICE, CLIPBOARD_SERVICE, CONNECTIVITY_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, KEYGUARD_SERVICE, LAYOUT_INFLATER_SERVICE, LOCATION_SERVICE, MODE_APPEND, MODE_PRIVATE, MODE_WORLD_READABLE, MODE_WORLD_WRITEABLE, NOTIFICATION_SERVICE, POWER_SERVICE, SEARCH_SERVICE, SENSOR_SERVICE, STATUS_BAR_SERVICE, TELEPHONY_SERVICE, VIBRATOR_SERVICE, WALLPAPER_SERVICE, WIFI_SERVICE, WINDOW_SERVICE
 
Constructor Summary
TestListActivity()
          Constructor that doesn't do much.
 
Method Summary
abstract  String getTestSuite()
          Subclasses should implement this to return the names of the classes of their tests.
 void onCreate(Bundle icicle)
          Typical onCreate(Bundle icicle) implementation.
 boolean onCreateOptionsMenu(Menu menu)
          Initialize the contents of the Activity's standard options menu.
protected  void onListItemClick(ListView l, View v, int position, long id)
          This method will be called when an item in the list is selected.
 boolean onOptionsItemSelected(MenuItem item)
          This hook is called whenever an item in your options menu is selected.
 boolean onPrepareOptionsMenu(Menu menu)
          Prepare the Screen's standard options menu to be displayed.
protected  void onResume()
          Called after Activity.onRestoreInstanceState(android.os.Bundle), Activity.onRestart(), or Activity.onPause(), for your activity to start interacting with the user.
 
Methods inherited from class android.app.ListActivity
getListAdapter, getListView, getSelectedItemId, getSelectedItemPosition, onContentChanged, onRestoreInstanceState, setListAdapter, setSelection
 
Methods inherited from class android.app.Activity
addContentView, closeOptionsMenu, createPendingResult, dismissDialog, dispatchKeyEvent, dispatchTouchEvent, dispatchTrackballEvent, finalize, findViewById, finish, finishActivity, finishActivityFromChild, finishFromChild, getApplication, getCallingActivity, getCallingPackage, getChangingConfigurations, getComponentName, getCurrentFocus, getInstanceCount, getIntent, getLastNonConfigurationInstance, getLayoutInflater, getLocalClassName, getMenuInflater, getParent, getPreferences, getRequestedOrientation, getSystemService, getTaskId, getTitle, getTitleColor, getVolumeControlStream, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, getWindow, getWindowManager, isChild, isFinishing, isTaskRoot, managedCommitUpdates, managedQuery, managedQuery, moveTaskToBack, onActivityResult, onApplyThemeResource, onChildTitleChanged, onConfigurationChanged, onContextItemSelected, onContextMenuClosed, onCreateContextMenu, onCreateDescription, onCreateDialog, onCreatePanelMenu, onCreatePanelView, onCreateThumbnail, onCreateView, onDestroy, onKeyDown, onKeyMultiple, onKeyUp, onLowMemory, onMenuItemSelected, onMenuOpened, onNewIntent, onOptionsMenuClosed, onPanelClosed, onPause, onPostCreate, onPostResume, onPrepareDialog, onPreparePanel, onRestart, onRetainNonConfigurationInstance, onSaveInstanceState, onSearchRequested, onStart, onStop, onTitleChanged, onTouchEvent, onTrackballEvent, onWindowAttributesChanged, onWindowFocusChanged, openContextMenu, openOptionsMenu, registerForContextMenu, removeDialog, requestWindowFeature, runOnUiThread, setContentView, setContentView, setContentView, setDefaultKeyMode, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setIntent, setPersistent, setProgress, setProgressBarIndeterminate, setProgressBarIndeterminateVisibility, setProgressBarVisibility, setRequestedOrientation, setResult, setResult, setSecondaryProgress, setTitle, setTitle, setTitleColor, setVolumeControlStream, showDialog, startActivity, startActivityForResult, startActivityFromChild, startActivityIfNeeded, startManagingCursor, startNextMatchingActivity, startSearch, stopManagingCursor, takeKeyEvents, unregisterForContextMenu
 
Methods inherited from class android.view.ContextThemeWrapper
attachBaseContext, getTheme, setTheme
 
Methods inherited from class android.content.ContextWrapper
bindService, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingPermission, checkCallingUriPermission, checkPermission, checkUriPermission, checkUriPermission, clearWallpaper, createPackageContext, databaseList, deleteDatabase, deleteFile, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, enforceUriPermission, fileList, getApplicationContext, getAssets, getBaseContext, getCacheDir, getClassLoader, getContentResolver, getDatabasePath, getDir, getFilesDir, getFileStreamPath, getMainLooper, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getResources, getSharedPreferences, getWallpaper, grantUriPermission, openFileInput, openFileOutput, openOrCreateDatabase, peekWallpaper, registerReceiver, registerReceiver, removeStickyBroadcast, revokeUriPermission, sendBroadcast, sendBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendStickyBroadcast, setWallpaper, setWallpaper, startInstrumentation, startService, stopService, unbindService, unregisterReceiver
 
Methods inherited from class android.content.Context
getString, getString, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PERFORMANCE_TESTS

public static final String PERFORMANCE_TESTS
Supplied in the intent extras if we are running performance tests.

See Also:
Constant Field Values

MODE_GROUP

static final int MODE_GROUP
"Mode" group in the menu.

See Also:
Constant Field Values

mSuite

String mSuite
Our suite


mTests

String[] mTests
Our children tests

Constructor Detail

TestListActivity

public TestListActivity()
Constructor that doesn't do much.

Method Detail

getTestSuite

public abstract String getTestSuite()
Subclasses should implement this to return the names of the classes of their tests.

Returns:
test suite class name

onCreate

public void onCreate(Bundle icicle)
Typical onCreate(Bundle icicle) implementation.

Overrides:
onCreate in class Activity
Parameters:
icicle - If the activity is being re-initialized after previously being shut down then this Bundle contains the data it most recently supplied in Activity.onSaveInstanceState(android.os.Bundle). Note: Otherwise it is null.
See Also:
Activity.onStart(), Activity.onSaveInstanceState(android.os.Bundle), Activity.onRestoreInstanceState(android.os.Bundle), Activity.onPostCreate(android.os.Bundle)

onResume

protected void onResume()
Description copied from class: Activity
Called after Activity.onRestoreInstanceState(android.os.Bundle), Activity.onRestart(), or Activity.onPause(), for your activity to start interacting with the user. This is a good place to begin animations, open exclusive-access devices (such as the camera), etc.

Keep in mind that onResume is not the best indicator that your activity is visible to the user; a system window such as the keyguard may be in front. Use Activity.onWindowFocusChanged(boolean) to know for certain that your activity is visible to the user (for example, to resume a game).

Derived classes must call through to the super class's implementation of this method. If they do not, an exception will be thrown.

Overrides:
onResume in class Activity
See Also:
Activity.onRestoreInstanceState(android.os.Bundle), Activity.onRestart(), Activity.onPostResume(), Activity.onPause()

onCreateOptionsMenu

public boolean onCreateOptionsMenu(Menu menu)
Description copied from class: Activity
Initialize the contents of the Activity's standard options menu. You should place your menu items in to menu.

This is only called once, the first time the options menu is displayed. To update the menu every time it is displayed, see Activity.onPrepareOptionsMenu(android.view.Menu).

The default implementation populates the menu with standard system menu items. These are placed in the Menu.CATEGORY_SYSTEM group so that they will be correctly ordered with application-defined menu items. Deriving classes should always call through to the base implementation.

You can safely hold on to menu (and any items created from it), making modifications to it as desired, until the next time onCreateOptionsMenu() is called.

When you add items to the menu, you can implement the Activity's Activity.onOptionsItemSelected(android.view.MenuItem) method to handle them there.

Overrides:
onCreateOptionsMenu in class Activity
Parameters:
menu - The options menu in which you place your items.
Returns:
You must return true for the menu to be displayed; if you return false it will not be shown.
See Also:
Activity.onPrepareOptionsMenu(android.view.Menu), Activity.onOptionsItemSelected(android.view.MenuItem)

onOptionsItemSelected

public boolean onOptionsItemSelected(MenuItem item)
Description copied from class: Activity
This hook is called whenever an item in your options menu is selected. The default implementation simply returns false to have the normal processing happen (calling the item's Runnable or sending a message to its Handler as appropriate). You can use this method for any items for which you would like to do processing without those other facilities.

Derived classes should call through to the base class for it to perform the default menu handling.

Overrides:
onOptionsItemSelected in class Activity
Parameters:
item - The menu item that was selected.
Returns:
boolean Return false to allow normal menu processing to proceed, true to consume it here.
See Also:
Activity.onCreateOptionsMenu(android.view.Menu)

onPrepareOptionsMenu

public boolean onPrepareOptionsMenu(Menu menu)
Description copied from class: Activity
Prepare the Screen's standard options menu to be displayed. This is called right before the menu is shown, every time it is shown. You can use this method to efficiently enable/disable items or otherwise dynamically modify the contents.

The default implementation updates the system menu items based on the activity's state. Deriving classes should always call through to the base class implementation.

Overrides:
onPrepareOptionsMenu in class Activity
Parameters:
menu - The options menu as last shown or first initialized by onCreateOptionsMenu().
Returns:
You must return true for the menu to be displayed; if you return false it will not be shown.
See Also:
Activity.onCreateOptionsMenu(android.view.Menu)

onListItemClick

protected void onListItemClick(ListView l,
                               View v,
                               int position,
                               long id)
Description copied from class: ListActivity
This method will be called when an item in the list is selected. Subclasses should override. Subclasses can call getListView().getItemAtPosition(position) if they need to access the data associated with the selected item.

Overrides:
onListItemClick in class ListActivity
Parameters:
l - The ListView where the click happened
v - The view that was clicked within the ListView
position - The position of the view in the list
id - The row id of the item that was clicked

Build 1.0_r1(from source)

Please submit a feedback, bug or feature