流程:1.在新建页面输入标题(et_title)和内容(et_content)
2.点击“提交(btn_submit)”,添加至SQLite数据库
3.点击“Log显示数据(btn_show)”,通过Log查看数据库中已存数据
1.SoundFragment(新建页)
(效果如下)
public class SoundFragment extends Fragment {
String TAG = "TAG";
private EditText et_title,et_content;
private Button btn_submit,btn_show;
private SQLiteDatabase db;
MySQLiteHelper helper;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.sound_fragment, container, false);
return view;
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
// TODO Auto-generated method stub