@Override protected void onCreate(Bundle savedInstanceState) { ib_about.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { //check the internet is avaiable or not if(!new NetworkAccess().isOnline(cm)){ new NetworkAccess().dialog_openInternet(builder); }else{ Intent intent = new Intent(CameraList.this, About.class); intent.putExtras(bundle); startActivityForResult(intent, 1); } } }); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == 1) { if (resultCode == RESULT_OK) { String result = data.getStringExtra("data"); if (result.equals("done_logout")) { // VLCApplication.setIsStopThumbloading(true); CameraList.this.finish(); }else{ //update userinfo from ModifyUser if(VLCApplication.getIsUpdateUserInfo()){ if (getIntent().getExtras() != null) { bundle = getIntent().getExtras(); // bundle.putString("email", VLCApplication.getModifyUser_email()); bundle.putString("u_name", VLCApplication.getModifyUser_name()); bundle.putString("PWD", VLCApplication.getModifyUser_pwd()); VLCApplication.setIsUpdateUserInfo(false); } } } } } }
About.java
@Override protected void onCreate(Bundle savedInstanceState) { ib_goback.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // EventSetting.this.finish(); isLogout="NotYet"; About.this.finish(); } }); rl_logout.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { isLogout="done_logout"; About.this.finish(); } }); } @Override public void finish() { Intent it = new Intent(); it.putExtra("data", isLogout); setResult(RESULT_OK, it); super.finish(); }
沒有留言:
張貼留言