Skip to content

Instantly share code, notes, and snippets.

@mdennis10
Created August 11, 2015 19:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdennis10/eaf0f8c71c89d5fdf804 to your computer and use it in GitHub Desktop.
Save mdennis10/eaf0f8c71c89d5fdf804 to your computer and use it in GitHub Desktop.
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
Dao<Integer, Note> dao = EasyLite.getInstance(this)
.getDao(Note.class);
// Check if Note table contain any
// record
if (!dao.isExist()) {
// add code to save data you want
}
}
}
<application
android:allowBackup="true"
android:name=".MyApplication"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
....
</application>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment