android.support.v4.content
Class ContextCompat

java.lang.Object
  extended by android.support.v4.content.ContextCompat
Direct Known Subclasses:
ActivityCompat

public class ContextCompat
extends Object

Helper for accessing features in Context introduced after API level 4 in a backwards compatible fashion.


Constructor Summary
ContextCompat()
           
 
Method Summary
static boolean startActivities(android.content.Context context, android.content.Intent[] intents)
          Start a set of activities as a synthesized task stack, if able.
static boolean startActivities(android.content.Context context, android.content.Intent[] intents, android.os.Bundle options)
          Start a set of activities as a synthesized task stack, if able.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextCompat

public ContextCompat()
Method Detail

startActivities

public static boolean startActivities(android.content.Context context,
                                      android.content.Intent[] intents)
Start a set of activities as a synthesized task stack, if able.

In API level 11 (Android 3.0/Honeycomb) the recommended conventions for app navigation using the back key changed. The back key's behavior is local to the current task and does not capture navigation across different tasks. Navigating across tasks and easily reaching the previous task is accomplished through the "recents" UI, accessible through the software-provided Recents key on the navigation or system bar. On devices with the older hardware button configuration the recents UI can be accessed with a long press on the Home key.

When crossing from one task stack to another post-Android 3.0, the application should synthesize a back stack/history for the new task so that the user may navigate out of the new task and back to the Launcher by repeated presses of the back key. Back key presses should not navigate across task stacks.

startActivities provides a mechanism for constructing a synthetic task stack of multiple activities. If the underlying API is not available on the system this method will return false.

Parameters:
context - Start activities using this activity as the starting context
intents - Array of intents defining the activities that will be started. The element length-1 will correspond to the top activity on the resulting task stack.
Returns:
true if the underlying API was available and the call was successful, false otherwise

startActivities

public static boolean startActivities(android.content.Context context,
                                      android.content.Intent[] intents,
                                      android.os.Bundle options)
Start a set of activities as a synthesized task stack, if able.

In API level 11 (Android 3.0/Honeycomb) the recommended conventions for app navigation using the back key changed. The back key's behavior is local to the current task and does not capture navigation across different tasks. Navigating across tasks and easily reaching the previous task is accomplished through the "recents" UI, accessible through the software-provided Recents key on the navigation or system bar. On devices with the older hardware button configuration the recents UI can be accessed with a long press on the Home key.

When crossing from one task stack to another post-Android 3.0, the application should synthesize a back stack/history for the new task so that the user may navigate out of the new task and back to the Launcher by repeated presses of the back key. Back key presses should not navigate across task stacks.

startActivities provides a mechanism for constructing a synthetic task stack of multiple activities. If the underlying API is not available on the system this method will return false.

Parameters:
context - Start activities using this activity as the starting context
intents - Array of intents defining the activities that will be started. The element length-1 will correspond to the top activity on the resulting task stack.
options - Additional options for how the Activity should be started. See {@link android.content.Context#startActivity(Intent, Bundle)
Returns:
true if the underlying API was available and the call was successful, false otherwise


Copyright © 2013 Marek Kedzierski. All Rights Reserved.