show QQ Browser via Intent - Android Intent

Android examples for Intent:Browser Intent

Description

show QQ 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 showQQBrowser(Context context, String visitUrl) {
        Intent intent = new Intent();
        intent.setClassName("com.tencent.mtt",
                "com.tencent.mtt.MainActivity");
        intent.setAction(Intent.ACTION_VIEW);
        intent.addCategory(Intent.CATEGORY_DEFAULT);
        intent.setData(Uri.parse(visitUrl));
        context.startActivity(intent);//from ww  w . j a va2s.  co  m
    }
}

Related Tutorials