AlertDialog.Builder builder = new AlertDialog.Builder(NotePadMainActivity.this);
builder.setTitle(“请输入密码”);
builder.setIcon(R.drawable.suo);
builder.setView(keytext);
builder.setPositiveButton(“确定”, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if(PrefVO.userPasswordValue.equals(keytext.getText().toString())){
PrefVO.appLock(false);
Toast.makeText(NotePadMainActivity.this,“已解除锁定”,Toast.LENGTH_LONG).show();
}
else {
Toast.makeText(NotePadMainActivity.this,“密码错误”,Toast.LENGTH_LONG).show();
NotePadMainActivity.this.finish();
}
}
});
builder.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
NotePadMainActivity.this.finish();
}
});
builder.create().show();
}
}
//刷新界面
private void flush() {
PrefVO.dataFlush();
noteVOList = access.findAllNote();
noteBaseAdapter = new NoteBaseAdapter(NotePadMainActivity.this, R.layout.item, noteVOList);
noteList.setAdapter(noteBaseAdapter);
noteNumText.setText(noteVOList.size() + “”);
}
private class OnItemSelectedListener implements AdapterView.OnItemClickListener {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
note = noteVOList.get(position);
Intent intent = new Intent();
intent.setClass(NotePadMainActivity.this, NotePadScanActivity.class);
Bundle bundle = new Bundle();
bundle.putParcelable(“note”, note);
intent.putExtra(“noteBundle”, bundle);
NotePadMainActivity.this.startActivity(intent);
}
}
private void showProgressDialog() {
pgDialog.setTitle(“loading…”);
pgDialog.setMessage(“少女祈祷中…”);
pgDialog.show();
new progressThread().start();
}
private Handler handler = new Handler(){
public void handleMessage(Message msg){
flush();
pgDialog.cancel();
}
};
private class progressThread extends Thread{
@Override
public void run() {
try{
Thread.sleep(10
《Android学习笔记总结+最新移动架构视频+大厂安卓面试真题+项目实战源码讲义》
【docs.qq.com/doc/DSkNLaERkbnFoS0ZF】 完整内容开源分享
00);
handler.sendEmptyMessage(1);
} catch (InterruptedException e) {
e.printStackTrace();