Example usage for android.content Intent Intent

List of usage examples for android.content Intent Intent

Introduction

In this page you can find the example usage for android.content Intent Intent.

Prototype

protected Intent(Parcel in) 

Source Link

Usage

From source file:Main.java

public static Intent openAlbum() {
    Intent intent = new Intent("android.intent.action.GET_CONTENT");
    intent.setType("image/*");
    return intent;
}

From source file:Main.java

private static Intent pickVideoIntent() {
    Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
    intent.setType("video/*"); // String VIDEO_UNSPECIFIED = "video/*";
    // Intent wrapperIntent = Intent.createChooser(innerIntent, null);
    return intent;
}

From source file:Main.java

public static Intent makeSystemAlbumIntent() {
    Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
    intent.setType("image/*");
    return intent;
}

From source file:Main.java

public static Intent getSMSIntent(String body) {
    Intent it = new Intent(Intent.ACTION_VIEW);
    it.putExtra("sms_body", body);
    it.setType("vnd.android-dir/mms-sms");
    return it;/* www.  j av a  2  s.  c  om*/
}

From source file:Main.java

public static Intent getNetworksOperatorsIntent() {
    Intent intent = new Intent(Intent.ACTION_MAIN);
    intent.setClassName("com.android.phone", "com.android.phone.NetworkSetting");
    return intent;
}

From source file:Main.java

public static Intent getShareInfoIntent(String info) {
    Intent intent = new Intent(Intent.ACTION_SEND);
    intent.setType("text/plain");
    return intent.putExtra(Intent.EXTRA_TEXT, info);
}

From source file:Main.java

public static Intent createShareIntent(String string) {
    Intent intent = new Intent(Intent.ACTION_SEND);
    intent.setType("text/plain");
    intent.putExtra(Intent.EXTRA_TEXT, string);
    return intent;
}

From source file:Main.java

public static Intent getShareTextIntent(String content) {
    Intent intent = new Intent(Intent.ACTION_SEND);
    intent.setType("text/plain");
    intent.putExtra(Intent.EXTRA_TEXT, content);
    return intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}

From source file:Main.java

static Intent makeShareIntent(String subject, String text) {
    final Intent intent = new Intent(Intent.ACTION_SEND);
    intent.setType("text/plain");
    intent.putExtra(Intent.EXTRA_SUBJECT, subject);
    intent.putExtra(Intent.EXTRA_TEXT, text);
    return intent;
}

From source file:Main.java

public static Intent newCallNumberIntent(String number) {
    return new Intent(new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + number)));
}