public class

GDListActivity

extends GDActivity
java.lang.Object
   ↳ android.content.Context
     ↳ android.content.ContextWrapper
       ↳ android.view.ContextThemeWrapper
         ↳ android.app.Activity
           ↳ greendroid.app.GDActivity
             ↳ greendroid.app.GDListActivity

Class Overview

An equivalent to ListActivity that manages a ListView.

Summary

[Expand]
Inherited Constants
From class android.app.Activity
From class android.content.Context
From interface greendroid.app.ActionBarActivity
Public Constructors
GDListActivity()
GDListActivity(ActionBar.Type actionBarType)
Public Methods
int createLayout()
Returns the identifier of the layout that needs to be created for this ActionBarActivity
ListAdapter getListAdapter()
Get the ListAdapter associated with this activity's ListView.
ListView getListView()
Get the activity's ListView widget.
long getSelectedItemId()
Get the ListAdapter row ID of the currently selected list item.
int getSelectedItemPosition()
Get the position of the currently selected list item.
void onPostContentChanged()
Called at the end of the onContentChanged() method.
void onPreContentChanged()
Called at the beginning of the onContentChanged() method.
void setActionBarContentView(View view)

Set the activity content to an explicit view.

void setActionBarContentView(View view, ViewGroup.LayoutParams params)

Set the activity content to an explicit view.

void setActionBarContentView(int resID)

Set the activity content from a layout resource.

void setListAdapter(ListAdapter adapter)
Provides the Adapter for the ListView handled by this GDListActivity
void setSelection(int position)
Set the currently selected list item to the specified position with the adapter's data
Protected Methods
void onListItemClick(ListView l, View v, int position, long id)
This method will be called when an item in the list is selected.
boolean verifyLayout()
Verify the given layout contains everything needed by this Activity.
[Expand]
Inherited Methods
From class greendroid.app.GDActivity
From class android.app.Activity
From class android.view.ContextThemeWrapper
From class android.content.ContextWrapper
From class android.content.Context
From class java.lang.Object
From interface android.content.ComponentCallbacks
From interface android.view.KeyEvent.Callback
From interface android.view.LayoutInflater.Factory
From interface android.view.View.OnCreateContextMenuListener
From interface android.view.Window.Callback
From interface greendroid.app.ActionBarActivity

Public Constructors

public GDListActivity ()

public GDListActivity (ActionBar.Type actionBarType)

Public Methods

public int createLayout ()

Returns the identifier of the layout that needs to be created for this ActionBarActivity

Returns
  • The layout identifier of the layout to create

public ListAdapter getListAdapter ()

Get the ListAdapter associated with this activity's ListView.

Returns
  • The ListAdapter currently associated to the underlying ListView

public ListView getListView ()

Get the activity's ListView widget.

Returns

public long getSelectedItemId ()

Get the ListAdapter row ID of the currently selected list item.

Returns
  • The identifier of the selected ListView item.

public int getSelectedItemPosition ()

Get the position of the currently selected list item.

Returns
  • The position of the currently selected ListView item.

public void onPostContentChanged ()

Called at the end of the onContentChanged() method. This may be use to initialize the content of the layout (titles, etc.)

public void onPreContentChanged ()

Called at the beginning of the onContentChanged() method. This may be used to initialize all references on elements.

public void setActionBarContentView (View view)

Set the activity content to an explicit view. This view is placed directly into the activity's view hierarchy. It can itself be a complex view hierarchy.

This method is an equivalent to setContentView(View) that automatically wraps the given layout in an ActionBarHost if needed.

Parameters
view The desired content to display.

public void setActionBarContentView (View view, ViewGroup.LayoutParams params)

Set the activity content to an explicit view. This view is placed directly into the activity's view hierarchy. It can itself be a complex view hierarchy.

This method is an equivalent to setContentView(View, LayoutParams) that automatically wraps the given layout in an ActionBarHost if needed.

Parameters
view The desired content to display.
params Layout parameters for the view.

public void setActionBarContentView (int resID)

Set the activity content from a layout resource. The resource will be inflated, adding all top-level views to the activity.

This method is an equivalent to setContentView(int) that automatically wraps the given layout in an ActionBarHost if needed..

Parameters
resID Resource ID to be inflated.

public void setListAdapter (ListAdapter adapter)

Provides the Adapter for the ListView handled by this GDListActivity

Parameters
adapter The ListAdapter to set.

public void setSelection (int position)

Set the currently selected list item to the specified position with the adapter's data

Parameters
position The position to select in the managed ListView

Protected Methods

protected void onListItemClick (ListView l, View v, int position, long id)

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.

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

protected boolean verifyLayout ()

Verify the given layout contains everything needed by this Activity. A GDActivity, for instance, manages an ActionBarHost. As a result this method will return true of the current layout contains such a widget.

Returns
  • true if the current layout fits to the current Activity widgets requirements