Here you can find the source of goToActivity(Context currentActivity, Class extends Activity> newClass)
public static void goToActivity(Context currentActivity, Class<? extends Activity> newClass)
//package com.java2s; import android.app.Activity; import android.content.Context; import android.content.Intent; public class Main { /** Switches to the given class (which must be a subclass of Activity). * You must also register the new Activity in AndroidManifest.xml. *//*from w w w . j a v a2s. c o m*/ public static void goToActivity(Context currentActivity, Class<? extends Activity> newClass) { Intent newActivity = new Intent(currentActivity, newClass); currentActivity.startActivity(newActivity); } }