GithubHelp home page GithubHelp logo

jineshfrancs / captchaimageview Goto Github PK

View Code? Open in Web Editor NEW
612.0 13.0 81.0 316 KB

Custom ImageView to generate captcha image.

License: Apache License 2.0

Java 100.00%
captcha-image captcha custom-imageview

captchaimageview's Issues

app crashed

capture
Error inflating class test.jinesh.captcha.CaptchaImageView

CaptchaImageView Exception

Hi,

I tried using the class for my project, but when i run the application it crashes.
*****This is my call

            <Button
                android:id="@+id/btnCaptchaRefresh"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_marginLeft="3dp"
                android:layout_marginStart="3dp"
                android:background="@drawable/synchronization1"
                android:onClick="refreshCaptcha" />
    <FrameLayout 
        android:id="@+id/flCaptchaContainer"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_toLeftOf="@+id/btnCaptchaRefresh" >                        
        <com.mjc.activity.common.CaptchaImageView
                   android:id="@+id/ivCaptcha"
                   android:layout_width="fill_parent"
                   android:layout_height="50dp"
		           android:scaleType="fitXY"
                	    android:layout_marginLeft="7dp"
                       android:adjustViewBounds="true" />
      </FrameLayout>

..........................

*****This is the stack trace i am getting.
07-26 18:55:22.466: E/AndroidRuntime(5511): FATAL EXCEPTION: main
07-26 18:55:22.466: E/AndroidRuntime(5511): Process: com.mjc.gametime.black, PID: 5511
07-26 18:55:22.466: E/AndroidRuntime(5511): java.lang.IllegalArgumentException: width and height must be > 0
07-26 18:55:22.466: E/AndroidRuntime(5511): at android.graphics.Bitmap.createBitmap(Bitmap.java:810)
07-26 18:55:22.466: E/AndroidRuntime(5511): at android.graphics.Bitmap.createBitmap(Bitmap.java:789)
07-26 18:55:22.466: E/AndroidRuntime(5511): at android.graphics.Bitmap.createBitmap(Bitmap.java:756)
07-26 18:55:22.466: E/AndroidRuntime(5511): at com.mjc.activity.common.CaptchaImageView$CaptchaGenerator.regenerate(CaptchaImageView.java:138)
07-26 18:55:22.466: E/AndroidRuntime(5511): at com.mjc.activity.common.CaptchaImageView$CaptchaGenerator.access$0(CaptchaImageView.java:127)
07-26 18:55:22.466: E/AndroidRuntime(5511): at com.mjc.activity.common.CaptchaImageView.draw(CaptchaImageView.java:36)
07-26 18:55:22.466: E/AndroidRuntime(5511): at com.mjc.activity.common.CaptchaImageView.reDraw(CaptchaImageView.java:111)
07-26 18:55:22.466: E/AndroidRuntime(5511): at com.mjc.activity.common.CaptchaImageView.onWindowFocusChanged(CaptchaImageView.java:256)
07-26 18:55:22.466: E/AndroidRuntime(5511): at android.view.View.dispatchWindowFocusChanged(View.java:8681)
07-26 18:55:22.466: E/AndroidRuntime(5511): at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:1060)
07-26 18:55:22.466: E/AndroidRuntime(5511): at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:1060)
07-26 18:55:22.466: E/AndroidRuntime(5511): at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:1060)
07-26 18:55:22.466: E/AndroidRuntime(5511): at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:1060)
07-26 18:55:22.466: E/AndroidRuntime(5511): at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:1060)
07-26 18:55:22.466: E/AndroidRuntime(5511): at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:1060)
07-26 18:55:22.466: E/AndroidRuntime(5511): at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:1060)
07-26 18:55:22.466: E/AndroidRuntime(5511): at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:1060)
07-26 18:55:22.466: E/AndroidRuntime(5511): at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3302)
07-26 18:55:22.466: E/AndroidRuntime(5511): at android.os.Handler.dispatchMessage(Handler.java:102)
07-26 18:55:22.466: E/AndroidRuntime(5511): at android.os.Looper.loop(Looper.java:135)
07-26 18:55:22.466: E/AndroidRuntime(5511): at android.app.ActivityThread.main(ActivityThread.java:5282)
07-26 18:55:22.466: E/AndroidRuntime(5511): at java.lang.reflect.Method.invoke(Native Method)
07-26 18:55:22.466: E/AndroidRuntime(5511): at java.lang.reflect.Method.invoke(Method.java:372)
07-26 18:55:22.466: E/AndroidRuntime(5511): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
07-26 18:55:22.466: E/AndroidRuntime(5511): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.