Example usage for android.content Intent getLongExtra

List of usage examples for android.content Intent getLongExtra

Introduction

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

Prototype

public long getLongExtra(String name, long defaultValue) 

Source Link

Document

Retrieve extended data from the intent.

Usage

From source file:Main.java

public static void setAlarmTime(Context context, long timeInMillis, Intent intent) {
    AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
    PendingIntent sender = PendingIntent.getBroadcast(context, intent.getIntExtra("id", 0), intent,
            PendingIntent.FLAG_CANCEL_CURRENT);
    int interval = (int) intent.getLongExtra("intervalMillis", 0);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        am.setWindow(AlarmManager.RTC_WAKEUP, timeInMillis, interval, sender);
    }//from  w ww .ja  v  a2  s.co m
}

From source file:com.github.kanata3249.ffxieq.android.MagicSelectorActivity.java

static public long getMagicId(Intent data) {
    return data.getLongExtra("Id", -1);
}

From source file:com.github.kanata3249.ffxieq.android.MagicSelectorActivity.java

static public long getMagicSubId(Intent data) {
    return data.getLongExtra("SubId", -1);
}

From source file:com.github.kanata3249.ffxieq.android.AtmaSelector.java

static public long getAtmaId(Intent data) {
    return data.getLongExtra("Id", -1);
}

From source file:com.github.kanata3249.ffxieq.android.VWAtmaLevelSelectorActivity.java

static public long getAtmaSubId(Intent data) {
    return data.getLongExtra("SubId", -1);
}

From source file:com.github.kanata3249.ffxieq.android.AugmentEditActivity.java

static public long getEquipmentId(Intent data) {
    return data.getLongExtra("BaseId", -1);
}

From source file:com.github.kanata3249.ffxieq.android.AugmentEditActivity.java

static public long getAugmentId(Intent data) {
    return data.getLongExtra("AugId", -1);
}

From source file:com.github.kanata3249.ffxieq.android.FoodSelectorActivity.java

static public long getFoodId(Intent data) {
    return data.getLongExtra("Id", -1);
}

From source file:org.chromium.chrome.browser.util.IntentUtils.java

/**
 * Just like {@link Intent#getLongExtra(String, long)} but doesn't throw exceptions.
 *//* w  ww.java2 s .  c o m*/
public static long safeGetLongExtra(Intent intent, String name, long defaultValue) {
    try {
        return intent.getLongExtra(name, defaultValue);
    } catch (Throwable t) {
        // Catches un-parceling exceptions.
        Log.e(TAG, "getLongExtra failed on intent " + intent);
        return defaultValue;
    }
}

From source file:org.zeroxlab.benchmark.Case.java

public final static long getResult(Intent intent) {
    long defaultResult = -1;
    return intent.getLongExtra(RESULT, defaultResult);
}