我正在使用复选框将数据保存在数据库中。如果选中,则应用程序通过保存数据重定向到其他屏幕,然后如果我单击设备后退按钮,则显示它的应用程序未选中。我该如何解决这个问题?我在这里放置代码
public void joinLisn(){
String shareProfileType2=Constants.PROFILE_SHARE_ALL;
String accessToken = null;
DatabaseHelper helper = new DatabaseHelper(getApplicationContext());
DatabaseUtility dao = new DatabaseUtility(helper);
try {
accessToken = dao.getAccessToken();
} catch (Exception e1) {
handler.sendEmptyMessage(1);
return;
}
if(accessToken == null || accessToken.length() == 0){
handler.sendEmptyMessage(1);
return;
}
Map<String , String> params = new HashMap<String,String>();
params.put(Constants.ACCESS_TOKEN_PARAM, accessToken);
params.put(Constants.LISN_ID_PARAM, id);
params.put(Constants.PROFILE_TYPE_PARAM,shareProfileType2);
Status status = null;
try {
status = Utils.joinLisn(params, this);
} catch (NullPointerException e) {
handler.sendEmptyMessage(12);
return;
} catch (JSONException e) {
handler.sendEmptyMessage(11);
return;
}
if(status == null){
handler.sendEmptyMessage(1);
} else if(status.getStatus().equalsIgnoreCase(Constants.SUCCESS)){
try {
Intent lisnDetailIntent = new Intent(this, LisnDetailTabView.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Bundle bundleObj = new Bundle();
bundleObj.putString("id", id);
bundleObj.putString("RSVP","In");
lisnDetailIntent.putExtras(bundleObj);
startActivityForResult(lisnDetailIntent,0);
overridePendingTransition(android.R.anim.slide_in_left, android.R.anim.slide_out_right);
handler.sendEmptyMessage(8);
} catch(Exception ex) {}
} else{
handler.sendEmptyMessage(2);
return;
}
}