com.github.ignition.support
Class IgnitedIntents

java.lang.Object
  extended by com.github.ignition.support.IgnitedIntents

public class IgnitedIntents
extends Object


Field Summary
static String MIME_TYPE_EMAIL
           
static String MIME_TYPE_TEXT
           
 
Constructor Summary
IgnitedIntents()
           
 
Method Summary
static boolean isIntentAvailable(android.content.Context context, android.content.Intent intent)
          Checks whether there are applications installed which are able to handle the given intent.
static boolean isIntentAvailable(android.content.Context context, String action, String mimeType)
          Checks whether there are applications installed which are able to handle the given action/type.
static boolean isIntentAvailable(android.content.Context context, String action, android.net.Uri uri, String mimeType)
          Checks whether there are applications installed which are able to handle the given action/data.
static android.content.Intent newCallNumberIntent(String phoneNumber)
          Creates an intent that will immediately dispatch a call to the given number.
static android.content.Intent newDialNumberIntent(String phoneNumber)
          Creates an intent that will open the phone app and enter the given number.
static android.content.Intent newEmailIntent(android.content.Context context, String address, String subject, String body)
           
static android.content.Intent newMapsIntent(String address, String placeTitle)
           
static android.content.Intent newSelectPictureIntent()
          Creates an intent which when fired, will launch the phone's picture gallery to select a picture from it.
static android.content.Intent newShareIntent(android.content.Context context, String subject, String message, String chooserDialogTitle)
           
static android.content.Intent newTakePictureIntent(File tempFile)
          Creates an intent which when fired, will launch the camera to take a picture that's saved to a temporary file so you can use it directly without going through the gallery.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIME_TYPE_EMAIL

public static final String MIME_TYPE_EMAIL
See Also:
Constant Field Values

MIME_TYPE_TEXT

public static final String MIME_TYPE_TEXT
See Also:
Constant Field Values
Constructor Detail

IgnitedIntents

public IgnitedIntents()
Method Detail

isIntentAvailable

public static boolean isIntentAvailable(android.content.Context context,
                                        String action,
                                        android.net.Uri uri,
                                        String mimeType)
Checks whether there are applications installed which are able to handle the given action/data.

Parameters:
context - the current context
action - the action to check
uri - that data URI to check (may be null)
mimeType - the MIME type of the content (may be null)
Returns:
true if there are apps which will respond to this action/data

isIntentAvailable

public static boolean isIntentAvailable(android.content.Context context,
                                        String action,
                                        String mimeType)
Checks whether there are applications installed which are able to handle the given action/type.

Parameters:
context - the current context
action - the action to check
mimeType - the MIME type of the content (may be null)
Returns:
true if there are apps which will respond to this action/type

isIntentAvailable

public static boolean isIntentAvailable(android.content.Context context,
                                        android.content.Intent intent)
Checks whether there are applications installed which are able to handle the given intent.

Parameters:
context - the current context
intent - the intent to check
Returns:
true if there are apps which will respond to this intent

newEmailIntent

public static android.content.Intent newEmailIntent(android.content.Context context,
                                                    String address,
                                                    String subject,
                                                    String body)

newShareIntent

public static android.content.Intent newShareIntent(android.content.Context context,
                                                    String subject,
                                                    String message,
                                                    String chooserDialogTitle)

newMapsIntent

public static android.content.Intent newMapsIntent(String address,
                                                   String placeTitle)

newTakePictureIntent

public static android.content.Intent newTakePictureIntent(File tempFile)
Creates an intent which when fired, will launch the camera to take a picture that's saved to a temporary file so you can use it directly without going through the gallery.

Parameters:
tempFile - the file that should be used to temporarily store the picture
Returns:
the intent

newSelectPictureIntent

public static android.content.Intent newSelectPictureIntent()
Creates an intent which when fired, will launch the phone's picture gallery to select a picture from it.

Returns:
the intent

newDialNumberIntent

public static android.content.Intent newDialNumberIntent(String phoneNumber)
Creates an intent that will open the phone app and enter the given number. Unlike newCallNumberIntent(String), this does not actually dispatch the call, so it gives the user a chance to review and edit the number.

Parameters:
phoneNumber - the number to dial
Returns:
the intent

newCallNumberIntent

public static android.content.Intent newCallNumberIntent(String phoneNumber)
Creates an intent that will immediately dispatch a call to the given number. NOTE that unlike newDialNumberIntent(String), this intent requires the Manifest.permission.CALL_PHONE permission to be set.

Parameters:
phoneNumber - the number to call
Returns:
the intent


Copyright © 2012. All Rights Reserved.