MainActivity.class 源码片段
private static final String TAG = “SQLiteLOG”;
private MenuSelect menuSelect;
public int _id;
private Button but_save,but_update,but_delete;
private EditText name,money,remark;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setVisibility(0);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, “Replace with your own action”, Snackbar.LENGTH_LONG)
.setAction(“Action”, null).show();
}
});
name = (EditText)findViewById(R.id.item_name);
money = (EditText)findViewById(R.id.item_money);
remark = (EditText)findViewById(R.id.item_remark);
Bundle bundle = getIntent().getExtras();
if(bundle != null){
_id = Integer.valueOf(bundle.getString(“id”));
name.setText(bundle.getString(“name”));
money.setText(bundle.getString(“money”));
remark.setText(bundle.getString(“remark”));
}
init(this);
}
近期评论