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