B4A Library Chrome Custom Tabs

A very simple wrapper just in case some one needs it .

It DependsOn android-support-v4 but its size exceeds attachments size limit .


ChromCustomTabs
Author:
SMM
Version: 0.01
  • ChromCustomTabs
    Methods:
    • Initialize (EventName As String)
    • chromeCustomTab (websiteURL As String)
      Do not forget http:// part of URL .
 

Attachments

  • ChromCustomTabs.zip
    23.4 KB · Views: 579

Inman

Well-Known Member
Licensed User
Longtime User
Works great. Thank you so much.

Is it possible to add a custom action, like "Share", to the overflow menu? Right now it has only "Open in Chrome".
 

kkkpe

Active Member
Licensed User
Longtime User
it would be really helpful if placed inside an activity-view with action menu
 

Multiverse app

Active Member
Licensed User
Longtime User
It crashes during initialization:

Logger connected to: LYF LS-5002
--------- beginning of crash
--------- beginning of main
Copying updated assets files (9)
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/app/BundleCompat;
at android.support.customtabs.CustomTabsIntent$Builder.<init>(CustomTabsIntent.java:202)
at smm.customtabs.CustomTabs._initialize(CustomTabs.java:71)
at smm.customtabs.CustomTabs.Initialize(CustomTabs.java:47)
at b4a.example.main._activity_create(main.java:380)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:342)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at b4a.example.main.afterFirstLayout(main.java:102)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5265)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:697)
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.app.BundleCompat" on path: DexPathList[[zip file "/data/app/b4a.example-1/base.apk"],nativeLibraryDirectories=[/vendor/lib64, /system/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
... 23 more
Suppressed: java.lang.ClassNotFoundException: android.support.v4.app.BundleCompat
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 24 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

** Activity (main) Resume **
 

peter202020

New Member
tanks for sharing this lib

i used this lib in my app but when i open a URL , ChoromeCustomTabs asks for choosing between Chrome and other Browsers such firefox and ...

can update this lib to avoid this problem by specifying the package name for intent that it used?

by this code:
intentCustomTabs.intent.setPackage("com.android.chrome");

in this

tnx
 
Top