public static void launchActivity ( Activity context , Class < ? extends Activity > activity , boolean closeCurrentActivity , Map < String , String > params ) { Intent intent = new Intent ( context , activity ) ; if ( params != null ) { Bundle bundle = new Bundle ( ) ; for ( Entry < String , String > param : params . entrySet ( ) ) { bundle . putString ( param . getKey ( ) , param . getValue ( ) ) ; } intent . putExtras ( bundle ) ; } context . startActivity ( intent ) ; if ( closeCurrentActivity ) { context . finish ( ) ; } }
Launch an Activity .