答えて

2

あなたはフラグメント取引がちょうど3.0と3.1のAPIのために十分に文書のバージョンを使用するつもりならば

FragmentTransactionクラスでaddremove、およびreplaceをチェックする必要があります。

具体的な例については、Performing Fragment Transactionsをチェックし、Fragmentsフレームワークのトピック全体を読んでください。私が知っている最高の資源の一つです。

また、これらのチュートリアルをチェックアウト: The Android 3.0 Fragments APIHow to use the Fragment class in the Android Honeycomb SDK。とにかく

、ここでのコードのクリッピングである:あなただけdetachまたはattachフラグメントにしたい場合は

Fragment f = new TestFragment(); 

FragmentTransaction ft = getFragmentManager().beginTransaction(); 
// Replaces an existing fragment with the newly created one 
ft.replace(R.id.the_frag, f); 
// Any transition you prefer 
ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE); 
// Add it to the stack so the transition will be remembered and could be reversed 
ft.addToBackStack(null); 
ft.commit(); 

これはアドオンで行うことができ、前述した、あなたが追加したとき、それはコンテンツビューです膨らませるようにしてください削除しますそれ。

関連する問題