show Steel Browser via Intent - Android Intent

Android examples for Intent:Browser Intent

Description

show Steel Browser via Intent

Demo Code


//package com.book2s;

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

import android.content.pm.PackageManager;
import android.net.Uri;

public class Main {

    public static void showSteelBrowser(Context context, String visitUrl) {
        gotoUrl(context, "com.kolbysoft.steel", visitUrl,
                context.getPackageManager());
    }/*from www.j av  a2s.c o  m*/

    private static void gotoUrl(Context context, String packageName,
            String url, PackageManager packageMgr) {
        try {
            Intent intent;
            intent = packageMgr.getLaunchIntentForPackage(packageName);
            intent.setAction(Intent.ACTION_VIEW);
            intent.addCategory(Intent.CATEGORY_DEFAULT);
            intent.setData(Uri.parse(url));
            context.startActivity(intent);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

Related Tutorials