Exemplo n.º 1
0
 @Override
 protected void onDestroy() {
   // TODO Auto-generated method stub
   super.onDestroy();
   helper.close();
   Log.i(TAG, "onDestroy");
 }
Exemplo n.º 2
0
 @SuppressWarnings("deprecation")
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   // TODO Auto-generated method stub
   super.onCreate(savedInstanceState);
   requestWindowFeature(Window.FEATURE_NO_TITLE);
   setContentView(R.layout.activity_main);
   initUI();
   initClickListener();
   layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
   helper = new DbHelper(getApplicationContext());
   mCursor = helper.query();
   mAdapter = new MyCursorAdapter(this, mCursor, true);
   listview.setAdapter(mAdapter);
   startManagingCursor(mCursor);
 }