我有佈局包裹成滾動型像這樣的主要活動:如何保持活動從滾動備份後調用另一個活動?
<ScrollView android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_weight="1">
,用戶可以向上和向下滾動,並有一些按鈕,當用戶向下滾動。
當用戶按下一個按鈕 - 我運行這樣的代碼:
public void onClick(View view)
{
Log.d(LOG_TAG, "onClick");
TireView tiat = (TireView)view;
Intent i = new Intent(TrailerInspectionActivity.this, TireInspectionActivity.class);
i.putExtra(TireInspectionActivity.INTENT_TIRE_NUMBER, tiat.getNumber());
if (tiat.getDepth() != -1)
{
i.putExtra(TireInspectionActivity.INTENT_DEPTH, tiat.getDepth());
i.putExtra(TireInspectionActivity.INTENT_PRESSURE, tiat.getPressure());
}
TrailerInspectionActivity.this.startActivityForResult(i, REQUEST_CODE_TIRE_INSPECTION_ACTIVITY);
}
TireInspectinActivity開始和節目,如彈出 - 我用theme.Dialog
了點。
只要用戶點擊並彈出窗口顯示 - 主要活動ScrollView一直向上滾動。 有什麼辦法可以防止這種情況發生?
我相信這應該是正確的答案,因爲如果沒有其他字段需要關注,ScrollView在開始另一個活動時不應該滾動。 – 2012-09-18 14:28:16
看到這個問題:http://stackoverflow.com/questions/6176391/stop-scrollview-from-auto-scrolling-to-an-edittext – 2012-09-18 14:41:53