Java tutorial
//package com.java2s; import android.os.Bundle; public class Main { public static long bundleGetStringLong(Bundle bundle, String key) { if (bundle == null) return -1; String s = bundle.getString(key); if (s == null) return -1; try { return Long.parseLong(s); } catch (NumberFormatException e) { return -1; } } }