我可以使用您用於在不同活動之間傳遞數據的相同過程嗎?這可以用於在活動和cursoradapter之間傳遞數據。 產生不運行時的錯誤是編譯將一個整數從一個customcursoradapter傳遞給一個活動
The constructor Intent(MyAdapterQuestion, Class<Basic_database_questionsActivity>) is undefined
Intent i = new Intent(MyAdapterQuestion.this, Basic_database_questionsActivity.class);
Bundle b = new Bundle();
// get the current value of timerStart variable and store it in timerlogic
//Log.e(LOGS, "Whatis the value of timerstart inside the intentcalls method" + aInt);
b.putInt("timerlogic", aInt);
我有一個適配器名爲MyAdapterQuestion並呼籲Basic_database_questionsActivity活動。
我有一個計數器,它的方法bindView方法
public void bindView(View v, Context context, Cursor c) {
if(radiopos1.isChecked())
{
// i want to update my main activity
// this method increment the correct answer by one I want to get that value and //pass it back to the activity
correctAnswer();
}
}
爲了上帝的愛,學會格式化你的代碼!這非常糟糕,幾乎是無禮的! –