新的Android开发者在这里。我正在做一个表单,让用户在搜索SQLite数据库之前设置一些搜索条件。表单的一部分包含一些复选框。我如何从“最佳实践”的角度去看待他们的价值观?在android中获取多个复选框值?
我习惯做PHP,所以我会设置一个返回数组或对象所有值的方法,然后在'onClick'方法中调用它,但这在Java中也是一个好主意?
我的代码如下所示:
// Setup a listener, and event handler for the onClick event of the button
buttonFind.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// Perform action on click
String text = "Button clicked";
int duration = Toast.LENGTH_SHORT;
Context context = getApplicationContext();
Toast toast = Toast.makeText(context, text, duration);
toast.show();
}
});
你的代码似乎没有“调用”任何东西。 – trutheality 2011-06-04 22:14:09