show Opera Browser via Intent - Android Intent

Android examples for Intent:Browser Intent

Description

show Opera Browser via Intent

Demo Code


//package com.book2s;

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

import android.net.Uri;

public class Main {

    public static void showOperaBrowser(Context context, String visitUrl) {
        Intent intent = new Intent();
        intent.setClassName("com.opera.mini.android",
                "com.opera.mini.android.Browser");
        intent.setAction(Intent.ACTION_VIEW);
        intent.addCategory(Intent.CATEGORY_DEFAULT);
        intent.setData(Uri.parse(visitUrl));
        context.startActivity(intent);/*from  w ww. jav  a  2  s  . c o  m*/
    }
}

Related Tutorials