Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import android.content.Context;
import android.content.Intent;

import android.net.Uri;

public class Main {
    /**
     * Launches a browser to the specified URL.
     *
     * @param context Android context
     * @param url URL to browse to
     */
    public static void launchToUrl(final Context context, final Uri url) {
        final Intent intent = new Intent(Intent.ACTION_VIEW, url);
        context.startActivity(intent);
    }
}