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

Unable to set Spotlight view on Actionbar menu item #78

Open
RupinSahu opened this issue Jan 22, 2018 · 4 comments
Open

Unable to set Spotlight view on Actionbar menu item #78

RupinSahu opened this issue Jan 22, 2018 · 4 comments

Comments

@RupinSahu
Copy link

RupinSahu commented Jan 22, 2018

hello Wooplr,
I am trying to set spotlightview on action bar menu item which is a delete option but spotlight throws an exception.
01-22 14:22:25.855 5652-5652/fwt_android. W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.getLocationInWindow(int[])' on a null object reference 01-22 14:22:25.855 5652-5652/fwt_android W/System.err: at com.wooplr.spotlight.target.ViewTarget.getPoint(ViewTarget.java:23) 01-22 14:22:25.855 5652-5652/fwt_android W/System.err: at com.wooplr.spotlight.shape.Circle.getFocusPoint(Circle.java:36) 01-22 14:22:25.855 5652-5652/fwt_android W/System.err: at com.wooplr.spotlight.shape.Circle.<init>(Circle.java:24) 01-22 14:22:25.855 5652-5652/fwt_android W/System.err: at com.wooplr.spotlight.SpotlightView$Builder.build(SpotlightView.java:1082) 01-22 14:22:25.855 5652-5652/fwt_android W/System.err: at com.wooplr.spotlight.SpotlightView$Builder.show(SpotlightView.java:1091) 01-22 14:22:25.855 5652-5652/fwt_android W/System.err: at com.wooplr.spotlight.utils.SpotlightSequence.startSequence(SpotlightSequence.java:123) 01-22 14:22:25.855 5652-5652/fwt_android W/System.err: at fwt_android.commons.ClsConstant.introSpotLight(ClsConstant.java:138) 01-22 14:22:25.855 5652-5652/fwt_android W/System.err: at fwt_android.activities.ActivityDetail.UI_Reference(ActivityDetail.java:207) 01-22 14:22:25.855 5652-5652/fwt_android W/System.err: at fwt_android.activities.ActivityDetail.onCreate(ActivityDetail.java:126) 01-22 14:22:25.855 5652-5652/fwt_android W/System.err: at android.app.Activity.performCreate(Activity.java:6237) 01-22 14:22:25.855 5652-5652/fwt_android W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) 01-22 14:22:25.855 5652-5652/fwt_android W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) 01-22 14:22:25.855 5652-5652/fwt_android W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 01-22 14:22:25.855 5652-5652/fwt_android W/System.err: at android.app.ActivityThread.-wrap11(ActivityThread.java) 01-22 14:22:25.855 5652-5652/fwt_android W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 01-22 14:22:25.856 5652-5652/fwt_android W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102) 01-22 14:22:25.856 5652-5652/fwt_android W/System.err: at android.os.Looper.loop(Looper.java:148) 01-22 14:22:25.856 5652-5652/fwt_android W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5417) 01-22 14:22:25.856 5652-5652/fwt_android W/System.err: at java.lang.reflect.Method.invoke(Native Method) 01-22 14:22:25.856 5652-5652/fwt_android W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 01-22 14:22:25.856 5652-5652/fwt_android W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Can you please guide how to do it through your Spotlight view.What I am doing is -


menuItem = toolbar.getMenu().findItem(R.id.action_delete);
                View[] viewsSpotLight = new View[]{linLayEdit, recyclerView, (View) menuItem};

                String[] uniqueUsageIDs = new String[]{"linLayEdit", "recyclerView", "delete"};
                String[] titles = new String[]{getString(R.string.txtEdit), getString(R.string.viewers), getString(R.string.txtDelete)};

                String[] subtitles = new String[]{getString(R.string.editYourProfile), getString(R.string.viewersOfYourProfile), getString(R.string.deleteYourProfile)};

                ClsConstant.introSpotLight(context, true, viewsSpotLight, titles, subtitles, uniqueUsageIDs
                        , getResources().getColor(R.color.yellow_dark), getResources().getColor(R.color.white), getResources().getColor(R.color.Dark_green));

                isFirstRunPreference.edit().putBoolean("isALogDetailFirstRun", true).apply();
@MarvinOpo
Copy link

@RupinSahu did you happen to have a work around on this? i am also having same issue.

@RupinSahu
Copy link
Author

RupinSahu commented Mar 7, 2018 via email

@cleemansen
Copy link

cleemansen commented Jul 19, 2018

This works for me (of course w/ your Spotlight lib!): https://stackoverflow.com/a/33337827/810944

@mariantoni
Copy link

Hello, first answer from this question works for me for Item menu :) https://stackoverflow.com/questions/10397613

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