package com.itant.joycity.tool;

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

/**
 * Created by 詹子聪 on 2016/10/14.
 */
public class AppTool {

    public static void openUrlWithBrowser(Context context, String url) {
        String realUrl = url;
        if (!realUrl.startsWith("http://") && !realUrl.startsWith("https://")) {
            realUrl = "http://" + realUrl;
        }

        Uri uri = Uri.parse(realUrl);
        Intent intent = new Intent(Intent.ACTION_VIEW, uri);
        context.startActivity(intent);

        /*// 跳转到网址
        Intent intent = new Intent();
        intent.setAction("android.intent.action.VIEW");
        Uri content_url = Uri.parse(clickMeUrl);
        intent.setData(content_url);
        startActivity(intent);*/
    }
}
