SQL那个是自己输出,用来查看SQL语句用的。
在匹配A21、A22的时候,出现了这个问题。
匹配A20,A19,A23之类的都可以的。for (int i = 0; i < c.getCount(); i++) {
item = new HashMap<String, String>();
try { item.put("name", new String(c.getBlob(0), "UTF-8"));
item.put("norm", new String(c.getString(1))); } catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
data.add(item);
c.moveToNext();
}
红字是出问题的地方。
解决方案 »
- 想给黑色的字体描白色的边
- android 不同activity中怎么传递参数,又不开启新的activity
- 急急急,又要大家帮忙了,在android2.2模拟器上安装软件
- 各位大大们推荐点入门android开发的书籍吧
- android 录音文件无法播放
- 请教一个 android 的超级菜鸟问题
- SAXReader解析xml抛异常
- 【100分!】2G网络下手机与电脑服务器socket通信的问题
- android 左边一个listview 点击item去更换右边listview的数据
- android 图表绘制 求指导
- 运用Proxy模式简化的Service的管理和使用的实例(附源码及工程文件)
- 求救WARN/InputManagerService
private SQLiteDatabase db;
private String sql;
private String[] classfield; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
setContentView(R.layout.classfydeep); final String classfied = (String) getIntent().getSerializableExtra(
"classfied"); db = SQLiteDatabase.openOrCreateDatabase(DBManager.DB_PATH + "/"
+ DBManager.DB_NAME, null); sql = "Select additives_name,classfied From class Where classfied Like '"
+ classfied + "%' AND id>5 ";
Log.e("sql", sql);
Cursor c = db.rawQuery(sql, null);
c.moveToFirst();
String[] list1 = new String[c.getCount()];
classfield = new String[c.getCount()];
for (int i = 0; i < list1.length; i++) {
try {
list1[i] = new String(c.getBlob(0), "UTF-8");
classfield[i] = c.getString(1);
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
c.moveToNext();
}
c.close();
db.close();
ListView listview = (ListView) findViewById(R.id.listView3);
listview.setAdapter(new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, list1));
listview.setOnItemClickListener(new ListViewClick());
} public class ListViewClick implements OnItemClickListener {
public void onItemClick(AdapterView<?> parent, View view, int position,
long id) {
newIntent(classfield[position]);
}
} public void newIntent(String temp) {
Intent intent = new Intent(ClassfiedSearchDeep.this,
ClassfiedResult.class);
intent.putExtra("classfied", temp);
startActivity(intent);
}}