deepikaellur89
Lurker
Hi all,
Im a beginner of android. Working on eclipse juno, gingerbread 2.3
im developing an app which helps doctors store information about their patients. I get the error force close on emulator when i include the code -
public class DBUtil {
private static final int DB_VERSION=6;
private Context context;
private SQLiteDatabase db;
public DBUtil(Context context)
{
this.context = context;
//causing error------------------------------------
OpenHelper openHelper = new OpenHelper(context);
db = openHelper.getWritableDatabase();
//--------------------------------------------------
}
public class Doctors extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.doctors);
final Context context = this;
Button b2 = (Button) findViewById(R.id.button2);
Button b3 = (Button) findViewById(R.id.button3);
final DBUtil dh = new DBUtil(context);
ArrayList<ClassDoctor> doctor = dh.listDoctors();
String all[] = new String[doctor.size()];
for(int i=0; i<doctor.size(); i++)
{
all = doctor.get(i).getName();
}
...
can anyone please help me to fix the error..
Im a beginner of android. Working on eclipse juno, gingerbread 2.3
im developing an app which helps doctors store information about their patients. I get the error force close on emulator when i include the code -
public class DBUtil {
private static final int DB_VERSION=6;
private Context context;
private SQLiteDatabase db;
public DBUtil(Context context)
{
this.context = context;
//causing error------------------------------------
OpenHelper openHelper = new OpenHelper(context);
db = openHelper.getWritableDatabase();
//--------------------------------------------------
}
public class Doctors extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.doctors);
final Context context = this;
Button b2 = (Button) findViewById(R.id.button2);
Button b3 = (Button) findViewById(R.id.button3);
final DBUtil dh = new DBUtil(context);
ArrayList<ClassDoctor> doctor = dh.listDoctors();
String all[] = new String[doctor.size()];
for(int i=0; i<doctor.size(); i++)
{
all = doctor.get(i).getName();
}
...
can anyone please help me to fix the error..
