Search This Blog

Sunday, June 19, 2016

Intent - Intent đến màn hình khác trong ListViewCustom

myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);


public void openURL(String urlToOpen) {
    if (!urlToOpen.startsWith("https://") && !urlToOpen.startsWith("http://")){
        urlToOpen = "http://" + urlToOpen;
    }

    final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlToOpen));

    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    getApplicationContext().startActivity(intent);
}

No comments:

Post a Comment