Back to project page RoboBinding-gallery.
The source code is released under:
Apache License
If you think the Android project RoboBinding-gallery listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.robobinding.gallery.activity; /* w ww.j a v a 2 s . c om*/ import org.robobinding.gallery.R; import org.robobinding.gallery.model.Product; import org.robobinding.gallery.model.typedcursor.GetAllQuery; import org.robobinding.gallery.model.typedcursor.ProductRowMapper; import org.robobinding.gallery.model.typedcursor.ProductTable; import org.robobinding.gallery.presentationmodel.TypedCursorPresentationModel; import android.database.sqlite.SQLiteDatabase; import android.os.Bundle; /** * * @since 1.0 * @version $Revision: 1.0 $ * @author Cheng Wei */ public class TypedCursorActivity extends AbstractActivity { private TypedCursorPresentationModel presentationModel; private SQLiteDatabase db; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); GetAllQuery<Product> allProductsQuery = new GetAllQuery<Product>(ProductTable.TABLE_NAME, new ProductRowMapper()); db = getDatabaseHelper().getReadableDatabase(); presentationModel = new TypedCursorPresentationModel(db, allProductsQuery); initializeContentView(R.layout.activity_typed_cursor, presentationModel); } @Override protected void onDestroy() { super.onDestroy(); presentationModel.cleanUp(); db.close(); } }