Problem in greenDao ORM for android

Problems with WiFi, SQLite ,Bluetooth, WiMax, Proxies, etc...

Problem in greenDao ORM for android

Postby za_allsite » Tue May 28, 2013 3:38 pm

I'm new in android and I want save some data to SQLite DataBase in my android app and I use greenDAO – Android ORM for SQLite. but i recieve an error when call insert metode (usersDao.insert(users))than app stoped. ERROR : The application Reminder has stoped unexepctedly.Please try again. Thanks in advance. this is my code.

private SQLiteDatabase db;
private DaoMaster master;
private DaoSession session;
private TB_UsersDao usersDao;
private TB_SettingDao settingDao;
Button button;
protected void onCreate(Bundle savedInstanceState) {
.......

DevOpenHelper helper = new DaoMaster.DevOpenHelper(this, "reminder_db", null);
db = helper.getWritableDatabase();
master = new DaoMaster(db);
session = master.newSession();
usersDao = session.getTB_UsersDao();
settingDao = session.getTB_SettingDao();
button = (Button)findViewById(R.id.btn_insert);
button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
addInfo();
}
});
}


public void addInfo(){

TB_Users users = new TB_Users(null,textViewname.getText().toString(),
textViewsubject.getText().toString());
long long1 = usersDao.insert(users);//ERROR happen in this line
}
za_allsite
Freshman
Freshman
 
Posts: 2
Joined: Tue May 21, 2013 8:16 pm

Top

Return to Networking & Database Problems

Who is online

Users browsing this forum: No registered users and 6 guests