I use Corwin42 Preferences library and I tried this code.
I get error bellow at runtime:
preferences_prefview_ready (java line: 456)
java.lang.ClassCastException: anywheresoftware.b4a.objects.CSBuilder[] cannot be cast to java.lang.CharSequence[]
at mg.rtsoft.alimanaka.preferences._prefview_ready(preferences.java:456)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:179)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:167)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:163)
at de.amberhome.preferences.PreferenceViewWrapper$MyPreferenceFragment.onViewCreated(PreferenceViewWrapper.java:253)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1314)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1528)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1595)
at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:758)
at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2363)
at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2149)
at android.support.v4.app.FragmentManagerImpl.optimizeAndExecuteOps(FragmentManager.java:2103)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2013)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:710)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5333)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
at dalvik.system.NativeStart.main(Native Method)
It is said that "anywheresoftware.b4a.objects.CSBuilder[] cannot be cast to java.lang.CharSequence[]". How can I solve this problem please?
Thank you in advance.
B4X:
Dim lstSigneZodiaque As ListPreference
Dim dummy As CSBuilder
dummy.Initialize
Dim cs() As CSBuilder = Array As CSBuilder(dummy,dummy,dummy)
Dim ty As Typeface
ty = Typeface.LoadFromAssets("velezodiac.ttf")
cs(0).Initialize.Typeface(ty).Append("P Y S Q T").PopAll
cs(1).Initialize.Typeface(ty).Append("p y s q t").PopAll
cs(2).Initialize.Typeface(ty).Append("B K E C F").PopAll
lstSigneZodiaque = cat1.AddListPreference("","IconeSigneZodiaque", "Kisary mifanaraka amin'ny andro","Misafidiana anaty lisitra", "0", Array As String("0", "1", "2"), cs)
I get error bellow at runtime:
preferences_prefview_ready (java line: 456)
java.lang.ClassCastException: anywheresoftware.b4a.objects.CSBuilder[] cannot be cast to java.lang.CharSequence[]
at mg.rtsoft.alimanaka.preferences._prefview_ready(preferences.java:456)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:179)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:167)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:163)
at de.amberhome.preferences.PreferenceViewWrapper$MyPreferenceFragment.onViewCreated(PreferenceViewWrapper.java:253)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1314)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1528)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1595)
at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:758)
at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2363)
at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2149)
at android.support.v4.app.FragmentManagerImpl.optimizeAndExecuteOps(FragmentManager.java:2103)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2013)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:710)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5333)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
at dalvik.system.NativeStart.main(Native Method)
It is said that "anywheresoftware.b4a.objects.CSBuilder[] cannot be cast to java.lang.CharSequence[]". How can I solve this problem please?
Thank you in advance.