其實在我的應用程序,我有一個按鈕上的ListView ..現在單擊該按鈕我已經做了一些更改..所以當我移動到之前的活動之後,此變化應該出現在該活動。 。但在我的情況下發生的變化,但不會出現後,我的listView按鈕存在的活動..我如何做到這一點,以便我的變化發生後立即離開我的第一activity..code我有wrritten :如何刷新活動
的ListView控件按鈕的onClick代碼:
public boolean stopCycleStage(View v)
{
Button butStop=(Button) findViewById(R.id.butStop);
TextView setStopTxtViewTitle =(TextView)findViewById(R.id.setStopTxtViewTitle);
Date currentDate=new Date();
int iStopStartCount = CycleManager.getSingletonObject().getStopStartCount();
Date dtStopDate = currentDate;
CycleManager.getSingletonObject().setStopStartDate(dtStopDate, iStopStartCount);
Date dtStart = CycleManager.getSingletonObject().getStartDate();
if (dtStopDate.getTime() == dtStart.getTime())
CycleManager.getSingletonObject().removeHistoryDate(dtStart);
butStop.setBackgroundResource(R.drawable.settings_but_disabled);
setStopTxtViewTitle.setTextColor(Color.parseColor("#808080"));
return true;
}
能否請您用一個例子 – AndroidDev
其實我的按鈕是listview..so exaplain它你所看到的代碼是隻有那個按鈕..現在當我點擊這個按鈕時,一些變化done..and我禁用了按鈕..現在,當我通過點擊硬件後退按鈕移動到以前的活動時,沒有發生變化此活動..但是當我退出應用程序,並再次開始發生變化..所以我希望的變化發生而不退出應用程序.. – AndroidDev