Android examples for android.os:Bundle
intercept Int Param from Bundle
import android.content.Intent; import android.os.Bundle; import android.os.Parcelable; public class Main{ public static int interceptIntParam(Bundle savedInstanceState, Intent intent, String paramName) { int ret = -1; if (savedInstanceState != null) { ret = savedInstanceState.getInt(paramName, -1); } else {/* www . j a v a 2s . c o m*/ if (intent != null) { Bundle incomming = intent.getExtras(); if (incomming != null) { ret = incomming.getInt(paramName, -1); } } } return ret; } }