-3
蔭試圖打開數據庫,但IAM越來越錯誤我的代碼有如下如何訪問SQLite數據庫在廣播接收器
public class MyReceiver extends BroadcastReceiver
{
SQLiteDatabase db;
@Override
public void onReceive(Context context, Intent intent)
{
Cursor c;
db=openOrCreateDatabase("Mydb",MODE_PRIVATE,null);
c=db.rawQuery("SELECT * from mytable",null);
c.moveToFirst();
String name;
name=c.getString(0);
Toast.makeText(context, "Today is " + name, Toast.LENGTH_LONG).show();
}
}
錯誤:
MODE_PRIVATE can not be resolved to a variable