在Android应用程序代码中实现Captcha

时间:2014-04-19 15:46:00

标签: java android

我必须在我的Android应用程序代码中实现Captcha,但在java类中有很多错误......

我做了这个例子:

https://github.com/floydfix/Android-Easy-Captcha

所有这一行中的Captcha.height字段不可见

this.height

TextCaptcha(int,int,int,TextCaptcha.TextOptions)方法未定义为TextCaptcha 类型:

public TextCaptcha(int wordLength, TextOptions opt){
    TextCaptcha(0, 0, wordLength, opt);
}

字段Captcha.width在

中不可见
im.setLayoutParams(new LinearLayout.LayoutParams(c.width *2, c.height *2));

构造函数MathCaptcha(int,int,MathCaptcha.MathOptions)未定义

Captcha c = new MathCaptcha(300, 100, MathOptions.PLUS_MINUS_MULTIPLY); 

请任何人可以帮助我或指定一个真正有效的脚本吗?

1 个答案:

答案 0 :(得分:1)

嘿@Hamamelis在将项目导入eclipse时应该执行以下操作,在相应的类中更改以下代码

this.setHeight(height);

在Mathcaptcha类中,然后

(c.getWidth() *2, c.getHeight() *2)
在CaptchatestActivity中

,你要做的最后一件事是从

更改方法名称
TextCaptcha(0, 0, wordLength, opt);

TextCaptch(0, 0, wordLength, opt);

在TextCapctha类中,并将该方法的返回类型设置为void。