Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

Crash with exception: Resources$NotFoundException: Resource is not a ColorStateList (color or path): TypedValue{t=0x2/d=0x7f0100b4 a=2} #22

Closed
Pantkowsky opened this issue Oct 25, 2017 · 1 comment

Comments

@Pantkowsky
Copy link

Pantkowsky commented Oct 25, 2017

Hi,

I'm getting a crash with a trace shown below.

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.project.app/com.project.camera.CameraActivity}: android.content.res.Resources$NotFoundException: Resource is not a ColorStateList (color or path): TypedValue{t=0x2/d=0x7f0100b4 a=2} at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2429) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2493) at android.app.ActivityThread.access$800(ActivityThread.java:166) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1283) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5584) at java.lang.reflect.Method.invokeNative(Method.java) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084) at dalvik.system.NativeStart.main(NativeStart.java) Caused by android.content.res.Resources$NotFoundException: Resource is not a ColorStateList (color or path): TypedValue{t=0x2/d=0x7f0100b4 a=2} at android.content.res.Resources.loadColorStateList(Resources.java:3620) at android.content.res.TypedArray.getColorStateList(TypedArray.java:355) at android.widget.TextView.setTextAppearance(TextView.java:2612) at android.support.v4.widget.TextViewCompat$TextViewCompatBaseImpl.setTextAppearance(TextViewCompat.java:154) at android.support.v4.widget.TextViewCompat.setTextAppearance(TextViewCompat.java:475) at com.tooltip.Tooltip.getContentView(Tooltip.java:117) at com.tooltip.Tooltip.<init>(Tooltip.java:95) at com.tooltip.Tooltip.<init>(Tooltip.java:60) at com.tooltip.Tooltip$Builder.build(Tooltip.java:774) at com.project.camera.CameraActivity.onCreate(CameraActivity.java:100) at android.app.Activity.performCreate(Activity.java:5442) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2393) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2493) at android.app.ActivityThread.access$800(ActivityThread.java:166) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1283) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5584) at java.lang.reflect.Method.invokeNative(Method.java) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084) at dalvik.system.NativeStart.main(NativeStart.java)

The tooltip is set up as follows:

new Tooltip.Builder(view) .setText(text) .setTextSize(R.dimen.text_16) .setTextColor(Color.BLACK) .setTypeface(Typeface.createFromAsset(context.getAssets(), "fonts/SomeTypeFace.otf")) .setCornerRadius(R.dimen.tooltip_radius) .setBackgroundColor(Color.parseColor("#eae8ea")) .setGravity(Gravity.TOP) .setDismissOnClick(true) .setPadding((float) 50) .build();

What could be the problem here? Would highly appreciate any tips. @florent37

@florent37
Copy link
Owner

florent37 commented Jan 11, 2018

you're on the wrong library,

mine is com.github.florent37.viewtooltip

and your bug is for com.tooltip.Tooltip.getContentView

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants