Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.content.Context;
import android.content.Intent;
import android.net.Uri;

public class Main {
    /**
     * Open a webpage with indicated http url
     * 
     * @param context   the application context
     * @param httpUrl   the http url to open
     */
    public static void openWebPage(Context context, String httpUrl) {
        Intent intent = new Intent(Intent.ACTION_VIEW);
        intent.setData(Uri.parse(httpUrl));
        context.startActivity(intent);
    }
}