अंदर मैं एक मुद्दा जहां मैं एक android.app.Dialog
एंड्रॉयड टुकड़ा संवाद
यहाँ में एक fragment
दिखाने की जरूरत है एक्सएमएल कोड
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<FrameLayout
android:id="@+id/marchecharts"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</FrameLayout>
</LinearLayout>
क्या मैं चाहता हूँ मेरी टुकड़ा द्वारा marchecharts
को बदलने के लिए है, किसी को भी यह कर सकते हैं है मदद
धन्यवाद
Dialog dialog = new Dialog(getActivity());
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.marche_charts_parent);
//this is the part I think I need
Fragment fragment = new MarcheChartsFragment();
FragmentTransaction ft = ((FragmentActivity) dialog.getOwnerActivity()).getFragmentManager().beginTransaction();
ft.replace(R.id.marchecharts, fragment);
ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
ft.addToBackStack(null);
ft.commit();
dialog.setCanceledOnTouchOutside(true);
dialog.getWindow().setLayout(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT);
dialog.show();
आपकी प्रतिक्रिया के लिए धन्यवाद! मुझे क्रिएटडिअलॉग में कोई त्रुटि मिली: टाइप मिस्चैच: दूसरे दृश्यों पर "रिटर्न व्यू" लाइन –
पर व्यू टू डायलॉग में कनवर्ट नहीं किया जा सकता है, मुझे नहीं लगता कि यह समस्या का उत्तर देता है, क्योंकि मेरे पास पहले से ही एक टुकड़ा है, मुझे बस दिखाने की ज़रूरत है यह एक संवाद में –
जहां तक मैं आपका प्रश्न समझता हूं। आप एक संवाद में अपना खुद का टुकड़ा प्रदर्शित करना चाहते हैं। यदि यह आपका प्रश्न है तो कोड मैं प्रदान करता हूं। – HpTerm