public void onClick(View v) {
// TODO Auto-generated method stub
result.setText(" ");
String busline = key.getText().toString();
Spinner spinner = null;
Bus bus = new Bus();
StringBuffer lines = new StringBuffer();
Cursor cursor = null;
if (busline != null && !busline.equals("")) {
System.out.println(spinner.getSelectedItem().toString());
if(spinner.getSelectedItem().toString().equals ("北京"))
cursor = database.rawQuery(
"select id,line,time,station,opposite from bus_line where city='北京' and line like '%"
+ busline + "%'", null);
if(spinner.getSelectedItem().toString().equals("深圳"))
cursor = database.rawQuery(
"select id,line,time,station,opposite from bus_line where city='深圳' and line like '%"
+ busline + "%'", null);
if(spinner.getSelectedItem().toString().equals("广州"))
cursor = database.rawQuery(
"select id,line,time,station,opposite from bus_line where city='广州' and line like '%"
+ busline + "%'", null);
哪位大神帮我看看,哪里错了啊?每次运行这里就强退,spinner的值获取错了吗?
------解决方案--------------------
强退应该能具体看到是哪一行啊
------解决方案--------------------
学会使用logcat 是android 开发的第一步 目测是数据库语言写的有问题, 找个sqlite测试一下语言