Java tutorial
//package com.java2s; import android.app.Activity; import java.io.Serializable; public class Main { public static <T extends Serializable> T getFirstParameter(Activity aContext, Class<T> aParameterClass) { if (aContext.getIntent() != null && aContext.getIntent().getExtras() != null) { return (T) aContext.getIntent().getExtras().get("parameter-0"); } else { return null; } } }