Create Intent to Show Web Page - Android Intent

Android examples for Intent:Browser Intent

Description

Create Intent to Show Web Page

Demo Code


//package com.java2s;

import android.app.Activity;

import android.content.Intent;

import android.net.Uri;

public class Main {
    public static void ShowWebPage(Activity currentActivity, String url) {
        Intent intent = new Intent();
        intent.setAction(Intent.ACTION_VIEW);
        intent.addCategory(Intent.CATEGORY_BROWSABLE);
        intent.setData(Uri.parse(url));//from   w  w  w.  jav  a 2s  . c om
        currentActivity.startActivity(intent);
    }
}

Related Tutorials