Android Time Square Calendar XML Error

Asked

Viewed 91 times

1

I’m trying to build a custom calendar for Android. And for this, I’m using the Android Times Qquare library, based on this Project. I imported the JAB from here. When using XML I took example from the site:

<com.squareup.timessquare.CalendarPickerView
android:id="@+id/calendar_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />

Gives error when trying to switch to graphic mode (Graphical Layout).

This is the error displayed just below the Graphical Layout:

Exception raised during rendering: Color value '16dp' must start with #
Exception details are logged in Window > Show View > Error Log
The following classes could not be instantiated:
- com.squareup.timessquare.CalendarPickerView (Open Class, Show Error Log)
See the Error Log (Window > Show View) for more details.
Tip: Use View.isInEditMode() in your custom views to skip code when shown in Eclipse
...
java.lang.NumberFormatException: Color value '16dp' must start with #
  at com.android.layoutlib.bridge.impl.ResourceHelper.getColor(ResourceHelper.java:72)
  at android.content.res.BridgeResources.getColor(BridgeResources.java:182)
  at com.squareup.timessquare.CalendarPickerView.<init>(CalendarPickerView.java:101)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(at sun.reflect.NativeConstructorAccessorImpl.newInstance(    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(    at java.lang.reflect.Constructor.newInstance(    at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.instantiateClass(ProjectCallback.java:438)
at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.loadView(ProjectCallback.java:190)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:207)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:132)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:806)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:385)

Logcar generated:

FATAL EXCEPTION: main
Process: com.example.exemplocalendario2, PID: 815
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.exemplocalendario2/com.example.exemplocalendario2.MainActivity}: android.view.InflateException: Binary XML file line #12: Error inflating class com.squareup.timessquare.CalendarPickerView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
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:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
by: android.view.InflateException: Binary XML file line #12: Error inflating class com.squareup.timessquare.CalendarPickerView
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:707)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290)
at android.app.Activity.setContentView(Activity.java:1929)
at com.example.exemplocalendario2.MainActivity.onCreate(MainActivity.java:14)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
... 11 more
by: java.lang.ClassNotFoundException: Didn't find class "com.squareup.timessquare.CalendarPickerView" on path: DexPathList[[zip file "/data/app/com.example.exemplocalendario2-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.exemplocalendario2-1, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at android.view.LayoutInflater.createView(LayoutInflater.java:559)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
... 21 more
  • Post the code where you switch the mode to the graphic mode... I can’t tell exactly where you’re making a mistake without the code, but the problem is that you’re passing a value that isn’t in hexa to set a color.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.