AlexS
AlexS

Reputation: 974

How to run chrome tools instead of browser

How i can run links in Chrome tools activity instead of Chrome browser application in Android?

I tried to use Intent, but it not helps.

Upvotes: 1

Views: 54

Answers (1)

AlexS
AlexS

Reputation: 974

I solve it.

newsAdapter.setOnItemClickListner(new NewsAdapter.onItemClickListner() {
        @Override
        public void onClick(String str) {
            //CUSTOM TABS
            CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
            builder.setToolbarColor(getResources().getColor(R.color.colorPrimary));
            builder.setShowTitle(true);
            builder.setCloseButtonIcon(BitmapFactory.decodeResource(
                    getResources(), R.drawable.ic_arrow_back));
            CustomTabsIntent customTabsIntent = builder.build();
            customTabsIntent.launchUrl(getContext(), Uri.parse(str));
        }
    });

Upvotes: 1

Related Questions