我有一个在eclipse中工作正常的代码,但是当我在我的智能手机中安装了apk时,我在数据库中进行搜索,向我显示“无效双重”的消息。 任何人都可以说为什么会这样?感谢
if (chkTipo.isChecked() != true
&& spinAno.getSelectedItem().toString() != "Ano"
&& spinMes.getSelectedItem().toString() == "Mes"
&& spinDia.getSelectedItem().toString() == "Dia") {
Bundle extras = new Bundle();
String year = tvData1.getText().toString()
.replace("Data: ", "");
extras.putString("year", year);
sumToView = Double.parseDouble(tvValor.getText().toString()
.replace("R$ : ", ""));
Toast_msg = "Ano" + year;
Show_Toast(Toast_msg);
extras.putDouble("sum", sumToView);
extras.putString("criterio", "ano");
view_user.putExtras(extras);
view_user.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
| Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(view_user);
finish();
}
辅助
public void onCreate(SQLiteDatabase db) {
try {
String CREATE_TRANSACOES_TABLE = "CREATE TABLE " + TABLE_TRANSACOES
+ "(" + KEY_ID + " INTEGER PRIMARY KEY," + DAY + " TEXT,"
+ MONTH + " TEXT," + YEAR + " TEXT," + ID_FROM_DESPESA
+ " INTEGER," + NOME_FROM_DESPESA + " TEXT," + KEY_VALUE
+ " double" + ")";
String CREATE_DESPESA_TABLE = "CREATE TABLE " + TABLE_DESPESAS
+ "(" + ID_DESPESA + " INTEGER PRIMARY KEY," + NOME_DESPESA
+ " TEXT" + ")";
db.execSQL(CREATE_DESPESA_TABLE);
db.execSQL(CREATE_TRANSACOES_TABLE);
} catch (SQLException se) {
Log.v("DatabaseHandler Oncreate SQLException",
Log.getStackTraceString(se));
} catch (Exception e) {
Log.v("DatabaseHandler Oncreate Exception",
Log.getStackTraceString(e));
}
}