Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom view error #29

Closed
essalah opened this issue Feb 15, 2016 · 3 comments
Closed

Custom view error #29

essalah opened this issue Feb 15, 2016 · 3 comments

Comments

@essalah
Copy link

essalah commented Feb 15, 2016

i have this bug when i try use a custom view ,

java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference

my code :

Tooltip.make(anchor.getContext(),
                new Tooltip.Builder(101)
                        .closePolicy(new Tooltip.ClosePolicy()
                                .insidePolicy(true, false)
                                .outsidePolicy(true, false), 30000)
                        .activateDelay(800)
                        .showDelay(300)
                        .withArrow(true)
                        .withOverlay(true)
                        .floatingAnimation(Tooltip.AnimationBuilder.SLOW)
                        .withStyleId(R.style.ToolTipLayoutCustomStyle)

                        .withCustomView(ResId, true)
                        .anchor(anchor, gravity)
                        .build()
        ).show();
@jheo
Copy link

jheo commented Feb 18, 2016

Custom view should contains a TextView with '@android:id/text1' id.

@essalah
Copy link
Author

essalah commented Feb 18, 2016

thank you , the problem have been solved, and you are right the problem appear by the Textview

@harshipatelb
Copy link

harshipatelb commented Jun 2, 2017

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference

Tooltip.make( List_of_cate_prod_Activity.this,
new Tooltip.Builder(101)
.anchor(v, Tooltip.Gravity.LEFT)
.closePolicy(new Tooltip.ClosePolicy(), 0)
.text("Hello")
.withArrow(true)
.withOverlay(false)
.withCustomView(R.layout.condition_tooltip, true) //don't work how to solve this
.withOverlay(false)
.maxWidth(metrics.widthPixels /2)
.typeface(Validations.setTypeface( ctx ))
.showDelay(900)
.build()
).show();

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

No branches or pull requests

4 participants