SQLite的小例子--备忘录(11)

来源:未知 责任编辑:责任编辑 发表时间:2014-01-20 07:51 点击:

    @Override 
    protected void onCreate(Bundle bundle) { 
        super.onCreate(bundle); 
        mDbHelper = new MyAdapter(this); 
        mDbHelper.open(); 
        setContentView(R.layout.test_edit); 
        mCategory = (Spinner) findViewById(R.id.category); 
        mTitleText = (EditText) findViewById(R.id.todo_edit_summary); 
        mBodyText = (EditText) findViewById(R.id.todo_edit_description); 
 
        Button confirmButton = (Button) findViewById(R.id.todo_edit_button); 
        mRowId = null; 
        Bundle extras = getIntent().getExtras(); 
        mRowId = (bundle == null) ? null : (Long) bundle 
                .getSerializable(MyAdapter.KEY_ROWID); 
        if (extras != null) { 
            mRowId = extras.getLong(MyAdapter.KEY_ROWID); 
        } 
        populateFields(); 
        confirmButton.setOnClickListener(new View.OnClickListener() { 
            public void onClick(View view) { 
                setResult(RESULT_OK); 
                finish(); 
            } 
 
        }); 
    } 
 
    private void populateFields() { 
        if (mRowId != null) { 
            Cursor todo = mDbHelper.fetchTest(mRowId); 
            startManagingCursor(todo); 
            String category = todo.getString(todo 
                    .getColumnIndexOrThrow(MyAdapter.KEY_CATEGORY)); 
             
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
用户名: 验证码:点击我更换图片
最新评论 更多>>

推荐热点

  • Android 完全退出程序
  • 原创:Android应用开发-Andorid歌词秀,含源码
  • android 屏幕保护
  • Android手机软件汉化教程---第四课 dex文件汉化
  • 众多Android 开源项目推荐,给力工作给力学习
  • Android Audio代码分析4
  • Android得到已安装的应用程序信息!
  • Android开发者指南(29) —— USB Host and Accessory
  • Android成长的幕后推手:工程师鲁宾
网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
Copyright © 2008-2015 计算机技术学习交流网. 版权所有

豫ICP备11007008号-1