You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Was working on a piece of code and I was under the impression that CustomTabsIntent could setPackageName() using customTabsIntent.intent.setPackageName("com.google.android.youtube"). Can anyone confirm if I am missing something... I had to put it in this form because I could setPackageName but it wouldn't work.
Intent intent = null;
try {
intent = new Intent(Intent.ACTION_VIEW);
intent.setPackage("com.google.android.youtube");
intent.setData(Uri.parse(url));
startActivity(intent);
} catch (ActivityNotFoundException e) {
CustomTabsIntent customTabsIntent = new CustomTabsIntent
.Builder()
.addDefaultShareMenuItem()
.setToolbarColor(view.getContext().getResources().getColor(R.color.colorPrimary))
.setShowTitle(true)
// .setCloseButtonIcon(backArrow)
.build();
// This is optional but recommended
CustomTabsHelper.addKeepAliveExtra(view.getContext(), customTabsIntent.intent);
// This is where the magic happens...
CustomTabsHelper.openCustomTab(view.getContext(), customTabsIntent,
Uri.parse(url),
new WebViewFallback());
}
The text was updated successfully, but these errors were encountered:
I tried that using customTabsIntent.intent.setPackageName("com.google.android.youtube") but it doesn't seem to work unless I use a plain old intent.... Any thoughts? I will try again, make sure I am not going crazy and double confirm.
Was working on a piece of code and I was under the impression that CustomTabsIntent could setPackageName() using
customTabsIntent.intent.setPackageName("com.google.android.youtube")
. Can anyone confirm if I am missing something... I had to put it in this form because I could setPackageName but it wouldn't work.The text was updated successfully, but these errors were encountered: