Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[Q] what the correct way to use ShowcaseView?

OP 11alex11

10th May 2014, 12:45 PM   |  #1  
OP Senior Member
Thanks Meter: 38
 
210 posts
Join Date:Joined: Jan 2011
when I try to use ShowcaseView I get error

Code:
    @override
        public void onActivityCreated(Bundle savedInstanceState) {
            super.onActivityCreated(savedInstanceState);

            final ImageButton saveButton = (ImageButton) view.findViewById(R.id.button_Save);
            ViewTarget viewTarget = new ViewTarget(saveButton);

            showcaseView = new ShowcaseView.Builder(getActivity())
                    .setTarget(viewTarget)
                    .setContentTitle("Reset Button")
                    .setContentText("This will erase all the data in the table except the line that in progress")
                    .build();
        }
when I tried to do the same thing in my fragmentactivity and didn't work, but when I did the same thing but took a view that declared in the fragmentactivity and not in the fragment it worked.

Logcat:

Code:
FATAL EXCEPTION: main
java.lang.IllegalArgumentException: width and height must be > 0
        at android.graphics.Bitmap.createBitmap(Bitmap.java:724)
        at android.graphics.Bitmap.createBitmap(Bitmap.java:703)
        at android.graphics.Bitmap.createBitmap(Bitmap.java:670)
        at com.github.amlcurran.showcaseview.ShowcaseView.updateBitmap(ShowcaseView.java:169)
        at com.github.amlcurran.showcaseview.ShowcaseView.onGlobalLayout(ShowcaseView.java:343)
        at android.view.ViewTreeObserver.dispatchOnGlobalLayout(ViewTreeObserver.java:839)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2050)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1249)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6364)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:791)
        at android.view.Choreographer.doCallbacks(Choreographer.java:591)
        at android.view.Choreographer.doFrame(Choreographer.java:561)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:777)
        at android.os.Handler.handleCallback(Handler.java:730)
        at android.os.Handler.dispatchMessage(Handler.java:92)
        at android.os.Looper.loop(Looper.java:176)
        at android.app.ActivityThread.main(ActivityThread.java:5419)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:525)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
        at dalvik.system.NativeStart.main(Native Method)
I understand what the error said but how can I fix it?
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes