com.github.droidfu.activities
Interface BetterActivity

All Known Implementing Classes:
BetterDefaultActivity, BetterExpandableListActivity, BetterListActivity, BetterMapActivity, BetterPreferenceActivity

public interface BetterActivity


Method Summary
 android.content.Intent getCurrentIntent()
          Retrieves the current intent that was used to create or resume this activity.
 int getWindowFeatures()
           
 boolean isApplicationBroughtToBackground()
          Android doesn't distinguish between your Activity being paused by another Activity of your own application, or by an Activity of an entirely different application.
 boolean isLandscapeMode()
           
 boolean isLaunching()
           
 boolean isPortraitMode()
           
 boolean isRestoring()
           
 boolean isResuming()
           
 android.app.AlertDialog newAlertDialog(int titleResourceId, int messageResourceId)
           
 android.app.AlertDialog newErrorHandlerDialog(Exception error)
           Creates a new error dialog, with the option to either dismiss or -- if an email application is installed -- report the given error.
 android.app.AlertDialog newErrorHandlerDialog(int titleResourceId, Exception error)
           Creates a new error dialog, with the option to either dismiss or -- if an email application is installed -- report the given error.
 android.app.AlertDialog newInfoDialog(int titleResourceId, int messageResourceId)
           
<T> android.app.Dialog
newListDialog(String title, List<T> listItems, DialogClickListener<T> listener, boolean closeOnSelect)
          Creates a new list style dialog from a list of objects.
 android.app.AlertDialog newYesNoDialog(int titleResourceId, int messageResourceId, android.content.DialogInterface.OnClickListener listener)
           
 void setProgressDialogMsgId(int progressDialogMsgId)
           
 void setProgressDialogTitleId(int progressDialogTitleId)
           
 

Method Detail

getWindowFeatures

int getWindowFeatures()

setProgressDialogTitleId

void setProgressDialogTitleId(int progressDialogTitleId)

setProgressDialogMsgId

void setProgressDialogMsgId(int progressDialogMsgId)

isRestoring

boolean isRestoring()
Returns:
true, if the activity is recovering from in interruption (i.e. onRestoreInstanceState was called.

isResuming

boolean isResuming()
Returns:
true, if the activity is "soft-resuming", i.e. onResume has been called without a prior call to onCreate

isLaunching

boolean isLaunching()
Returns:
true, if the activity is launching, i.e. is going through onCreate but is not restoring.

isApplicationBroughtToBackground

boolean isApplicationBroughtToBackground()
Android doesn't distinguish between your Activity being paused by another Activity of your own application, or by an Activity of an entirely different application. This function only returns true, if your Activity is being paused by an Activity of another app, thus hiding yours.

Returns:
true, if the Activity is being paused because an Activity of another application received focus.

getCurrentIntent

android.content.Intent getCurrentIntent()
Retrieves the current intent that was used to create or resume this activity. If the activity received a call to onNewIntent (e.g. because it was launched in singleTop mode), then the Intent passed to that method is returned. Otherwise the returned Intent is the intent returned by getIntent (which is the Intent which was used to initially launch this activity).

Returns:
the current Intent

isLandscapeMode

boolean isLandscapeMode()

isPortraitMode

boolean isPortraitMode()

newYesNoDialog

android.app.AlertDialog newYesNoDialog(int titleResourceId,
                                       int messageResourceId,
                                       android.content.DialogInterface.OnClickListener listener)

newInfoDialog

android.app.AlertDialog newInfoDialog(int titleResourceId,
                                      int messageResourceId)

newAlertDialog

android.app.AlertDialog newAlertDialog(int titleResourceId,
                                       int messageResourceId)

newErrorHandlerDialog

android.app.AlertDialog newErrorHandlerDialog(int titleResourceId,
                                              Exception error)

Creates a new error dialog, with the option to either dismiss or -- if an email application is installed -- report the given error. Clicking the report button will cause the app to collect diagnostic information, compile it to a single text body, and launch the email application with the error report being preset as the email's body.

For this to work, you must define the following string resources in your application:

Parameters:
titleResourceId - the string resource that should be used as the dialog title
error - the exception that should be displayed and/or reported
Returns:
the dialog

newErrorHandlerDialog

android.app.AlertDialog newErrorHandlerDialog(Exception error)

Creates a new error dialog, with the option to either dismiss or -- if an email application is installed -- report the given error. Clicking the report button will cause the app to collect diagnostic information, compile it to a single text body, and launch the email application with the error report being preset as the email's body.

For this to work, you must define the following string resources in your application:

Parameters:
error - the exception that should be displayed and/or reported
Returns:
the dialog

newListDialog

<T> android.app.Dialog newListDialog(String title,
                                     List<T> listItems,
                                     DialogClickListener<T> listener,
                                     boolean closeOnSelect)
Creates a new list style dialog from a list of objects. The toString() method of any such object will be used to generate the list item's label.

Type Parameters:
T - the type of the list items
Parameters:
dialogTitle - the title or null to disable the title
listItems - the list items
listener - the listener used for processing list item clicks
closeOnSelect - if true, the dialog will close when an item has been clicked
Returns:
the dialog


Copyright © 2011. All Rights Reserved.