我需要从数据库表中删除多行.这是我删除的代码
String[] paragraph;
.....
//here you can to put various strings within it (1 or more)
.....
db.delete(mytablename,"Paragraph = ?",paragraphs);
Run Code Online (Sandbox Code Playgroud)
它适用于1个字符串,但它不适用于更多字符串.有谁可以帮助我吗?
这里有LogCat显示的错误:
05-11 11:03:01.400: E/AndroidRuntime(767): FATAL EXCEPTION: main
05-11 11:03:01.400: E/AndroidRuntime(767): android.database.sqlite.SQLiteException: bind or column index out of range: handle 0x377500
05-11 11:03:01.400: E/AndroidRuntime(767): at android.database.sqlite.SQLiteProgram.native_bind_string(Native Method)
05-11 11:03:01.400: E/AndroidRuntime(767): at android.database.sqlite.SQLiteProgram.bindString(SQLiteProgram.java:241)
05-11 11:03:01.400: E/AndroidRuntime(767): at android.database.DatabaseUtils.bindObjectToProgram(DatabaseUtils.java:191)
05-11 11:03:01.400: E/AndroidRuntime(767): at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1769)
05-11 11:03:01.400: E/AndroidRuntime(767): at it.tirocinio.Segnalibro$3$3.onClick(Segnalibro.java:196)
05-11 11:03:01.400: E/AndroidRuntime(767): at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:158)
05-11 11:03:01.400: E/AndroidRuntime(767): at android.os.Handler.dispatchMessage(Handler.java:99)
05-11 11:03:01.400: E/AndroidRuntime(767): …Run Code Online (Sandbox Code Playgroud) 我需要你的帮助:)我有一个EditText,下面是ExpandableListView.我使用了BaseExpandableListAdapter和groups/child.我希望当用户在EditText中写入时,ExpandableListView只显示插入了文本的组(项).我认为我必须创建一个过滤器.这里有一段我的源代码.有人可以帮帮我吗?先感谢您
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState
setContentView(R.layout.main);
et = (EditText) findViewById(R.id.filterText);
et.setSingleLine();
et.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
// TODO Auto-generated method stub
if (et.getText().toString().equals(""))
elv.setBackgroundColor(Color.BLACK);
else
{
elv.setBackgroundColor(Color.WHITE);
}
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count,int after) {
// TODO Auto-generated method stub
}
@Override
public void afterTextChanged(Editable s) {
// TODO Auto-generated method stub
}
});
elv=getExpandableListView();
mAdapter = new MyExpandableListAdapter(fields_select,description);
elv.setAdapter(mAdapter);
class MyExpandableListAdapter …Run Code Online (Sandbox Code Playgroud)