Reputation: 974
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
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