試圖連接到數據庫; 我有一個問題context = null
(可能必須是)。我不明白有什麼問題試圖連接到數據庫,context = null
import java.util.HashMap;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
public class DatabaseTable extends Activity {
private Context context;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.database_table);
LBD conection = LBD.get(context); // (context = null) ???
Settings setting = new Settings(conection.getSQLiteDatabase());
setting.create();
}
}
嘗試DatabaseTable.this – Akshay 2012-08-09 13:32:04
給'context = DatabaseTable.th在'setcontentView()' – Praveenkumar 2012-08-09 13:33:47