Page 823 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 823
공중망을 이용한 애완동물 사료 공급기
return super.onCreateOptionsMenu(menu);
} //액션바 생성하는 부분
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.ip_setting:
Intent intentSubActivity = new Intent(MainActivity.this, SettingActivity.class);
startActivityForResult(intentSubActivity, 0);
break;
case R.id.action_setting:
input = help;
Intent i = new Intent(this, DatabaseLog.class);
startActivity(i);
break;
case R.id.recreate:
recreate();
break;
case R.id.Status_Delete:
AlertDialog.Builder alert = new AlertDialog.Builder(MainActivity.this);
alert.setNegativeButton("ㄴㄴ", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Toast.makeText(MainActivity.this, "데이터 삭제를 취소했습니다.",
Toast.LENGTH_SHORT).show();
}
});
alert.setPositiveButton("ㅇㅇ", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
help.resetStatus();
help.deleteLogDb(0);
try {
if (socket != null) {
socket.close();
networkReader.close();
인천전자마이스터고등학교
- 816 -