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

it crashes when try to open other activity from tooltip display on a activity and does not close it #6

Closed
satishkadyan opened this issue Jun 3, 2016 · 13 comments

Comments

@satishkadyan
Copy link

satishkadyan commented Jun 3, 2016

java.lang.IllegalArgumentException: width and height must be > 0
06-03 17:11:12.065 23299-23299/ W/System.err:     at android.graphics.Bitmap.createBitmap(Bitmap.java:836)
06-03 17:11:12.065 23299-23299/ W/System.err:     at android.graphics.Bitmap.createBitmap(Bitmap.java:815)
06-03 17:11:12.065 23299-23299/ W/System.err:     at android.graphics.Bitmap.createBitmap(Bitmap.java:782)
06-03 17:11:12.065 23299-23299/ W/System.err:     at io.github.douglasjunior.androidSimpleTooltip.OverlayView.createWindowFrame(OverlayView.java:72)
06-03 17:11:12.066 23299-23299/ W/System.err:     at io.github.douglasjunior.androidSimpleTooltip.OverlayView.dispatchDraw(OverlayView.java:65)
@douglasjunior
Copy link
Owner

I have to fix a similar problem in the past, what version you are using?

Could you show the code you are using to create the tooltip?

@satishkadyan
Copy link
Author

satishkadyan commented Jun 3, 2016

the below one , last last provided to me to use from here
com.github.douglasjunior:android-simple-tooltip:70145e60d2

code using to call tooltip, created a static method and pass and displaying tooltip in fragments and activities :-

    public static void addToolTipView(Activity activity, View view, String text, int gravity) {
        new SimpleTooltip.Builder(activity)
                .anchorView(view)
                .text(text)
                .gravity(gravity)
                .transparentOverlay(false)
                .backgroundColor(ContextCompat.getColor(activity.getApplicationContext(), R.color.yellow_accent_100))
                .arrowColor(ContextCompat.getColor(activity.getApplicationContext(), R.color.yellow_accent_100))
                .build()
                .show();
    }

@douglasjunior
Copy link
Owner

OK, thanks for the information. I'll make some tests.

Please, could you test with the most recent version?

dependencies {
    compile 'com.github.douglasjunior:android-simple-tooltip:0.1.1'
}

@satishkadyan
Copy link
Author

still crashing tried new dependency even. with same error stack as given above

@douglasjunior
Copy link
Owner

douglasjunior commented Jun 3, 2016

To replicate the problem:

  • What is the version of android you are running?
  • It is a real device or emulator?
  • You create the tooltip from a button-click or other event?
  • The error occurs when opening a new Activity without closing the previous tooltip?

I think that this error occours becouse the view root of your anchor view is not completly rendered, or has been closed.

@satishkadyan
Copy link
Author

  1. api 22 on real device (mobile moto e, same problem i faced on nexus 5 with api 23 too during testing).
  2. it is loading from listadapter. in getview of list adapter showing on 0th positiion element as list loaded, no click event or button visible.
  3. yes it happen only when tooltip is not closed and visible then you try to open other activity with any view click or from menu item from actionbar.

yes, when activity open new activity, there seems to be view achor or other seems to closed on unrendered. but it happen not during loading activity it working fine during activity load, and display tooltip correctly, just crashes when new activity through any link tried to open without closing currently displaying tooltip.

@satishkadyan
Copy link
Author

i am looking from my end too if i can fix, will inform you if i get some lead in fixing issue, thanks

@douglasjunior
Copy link
Owner

douglasjunior commented Jun 4, 2016

Thanks for the information, I think I understand. Then the anchor view is an adapter item?

I had not tried to open the tooltip from the adapter cycle. I will do some testing in the next week.

I work with RecyclerView, and I've used a RecyclerView item as an anchor view, but the tooltip was created by the Activity onResume and not inside the adapter.

@douglasjunior
Copy link
Owner

@satishkadyan you said the problem happens when opening a new activity without closing the tooltip. But if you touch the screen to open a new Activity, the tooltip will be closed by default.

I am creating a branch to be able to simulate the problem. In your list, you use ListView or RecyclerView?

@satishkadyan
Copy link
Author

yes i am using in listview and in adapter as you mentioned.

@douglasjunior
Copy link
Owner

@satishkadyan you can create a small project to simulate this problem?

@satishkadyan
Copy link
Author

ok, in weekend will create and provide demo project with problem.

@douglasjunior
Copy link
Owner

Hi @harshipatelb

In the Sample Project we have a small example using a custom content.

In this line we set a listener to display another tooltip.

Please, if you have questions open a new issue.

Repository owner deleted a comment from harshipatelb Jul 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants