Java tutorial
//package com.java2s; import android.content.Intent; public class Main { public static final String FIELD_ID = "field_id"; /** * @return the id of the field in which the result to be filled. Or, {@code -1} for error. */ public static int getFieldId(Intent intent) { if (intent == null) { return -1; } return intent.getIntExtra(FIELD_ID, -1); } }