onConfigurationChanged()
タイトルが示すように、アクティビティのイベントをトリガーするためにデバイスを縦向きから横向きに、または横向きから縦向きに切り替えるまでスクロールしないScrollViewがあります。
Nexus S(2.3.3)とエミュレーター(4.0.3)でアクティビティを試しましたが、同じ奇妙な動作が表示されます。
レイアウトがアクティビティに適用されるときにも試してみましたが、まだ運がありません。
アクティビティのXMLレイアウトはここにあります(少し長いので、質問をXMLで乱雑にしたくありませんでした)。
これが私を助けるためにあなたたちが見るのに関連するかもしれないいくつかのコードです:
/** {@inheritDoc} */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.terms_and_agreements);
//fire up the AsyncTask to get data
showLoadingProgress();
mBookingInfoTask = new BookingInfoTask();
mBookingInfoTask.execute();
}
/** {@inheritDoc} */
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
}
/** This methode is called when the BookingInfoTask has finished collecting date from the server */
public void onBookingInfoResult(String clubTerms, String portalTerms) {
final String fClubTerms = clubTerms;
final String fPortalTerms = portalTerms;
runOnUiThread(new Runnable() {
public void run() {
TextView tvTerms = (TextView) findViewById(R.id.tvTerms);
tvTerms.setText(fClubTerms + "\n\n" + fPortalTerms);
}
});
hideProgress(); //Hides progress bar
}
そして最後に、これが私のアクティビティのマニフェスト宣言です:
<activity
android:name=".ConfirmationActivity"
android:configChanges="keyboardHidden|orientation"
android:theme="@android:style/Theme.NoTitleBar" />