Android examples for android.content:Intent
open In Browser
import android.app.Activity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; public class Main{ public static void openInBrowser(Activity source, String siteHttp) { Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(siteHttp));/*w w w . j a v a 2 s . c om*/ source.startActivity(myIntent); } public static void startActivity(Activity root, Class<?> activityClass, Bundle extras) { if (extras == null) { throw new RuntimeException( "Bundle is null, use method without bundle."); } Intent intent = new Intent(root, activityClass); intent.putExtras(extras); root.startActivity(intent); } public static void startActivity(Activity root, Class<?> activityClass) { Intent intent = new Intent(root, activityClass); root.startActivity(intent); } }