2016-05-19 14 views
0

I ListFragmentのカスタムエラーDialogFragmentのエラーが表示されます。そのエラーを示しています。 私はそこにこだわっていますカスタムダイアログでListFragmentを使用すると、複数のマップを持つ

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@color/sky_blue" 
    android:orientation="vertical"> 

    <TextView 
     android:id="@+id/upcomingShifts" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:gravity="center" 
     android:textColor="@color/black" 
     android:textSize="@dimen/text_size_24sp" 
     android:padding="@dimen/padding_10dp" 
     android:text="@string/upcoming_shifts"/> 
    <FrameLayout 
     android:id="@+id/frameLayout" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 

     <fragment 
      android:id="@+id/lvMapFragment" 
      class="android.support.v4.app.ListFragment" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" /> 

    </FrameLayout> 

</LinearLayout> 

を私を助けここに私のカスタムダイアログコード

あなたがレイアウトを変更しようとすることができます
@Override 

    protected Dialog onCreateDialogPost(Bundle savedInstanceState) { 
     dialog = new Dialog(getActivity(), R.style.AppDialogTheme); 
     dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); 
     dialog.setContentView(R.layout.activity_up_coming_shift); 
     WindowManager windowManager = (WindowManager) getActivity().getSystemService(Context.WINDOW_SERVICE); 
     dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); 
//  dialog.getWindow().getAttributes().windowAnimations = R.style.AppDialogPullAnimation; 
     WindowManager.LayoutParams layoutParams = dialog.getWindow().getAttributes(); 
     Display display = windowManager.getDefaultDisplay(); 
     Point point = new Point(); 
     display.getSize(point); 
     int width = point.x - 40; 
     layoutParams.gravity = Gravity.TOP | Gravity.LEFT; 
     dialog.getWindow().setLayout(width, ViewGroup.LayoutParams.MATCH_PARENT); 
     dialog.setCancelable(true); 
     init(); 
     return dialog; 
    } 
+0

あなたがレイアウトし、また、エラーログを膨らまコードを表示してください。 – ishmaelMakitla

+0

も間違いを投稿してください。 – Sush

+0

android.view.InflateException:バイナリXMLファイル行#23:クラスフラグメントinflatingエラー –

答えて

-1

です。

あなたのコード:

<fragment 
     android:id="@+id/lvMapFragment" 
     class="android.support.v4.app.ListFragment" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" /> 

新コード:

<fragment 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:name="package_name_of_your_class_that_extends_ListFragment" 
      android:id="@+id/lvMapFragment" 
      tools:layout="@layout/name_of_your_layout_use_in_above_class" 
      /> 
+0

私の場合には機能しません。なぜなら、私はlistfragmentを拡張していないからです。 –

関連する問題