inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

윤재성의 Java 기반 Android 9.0(pie) App 개발 고급 3단계

9강 DrawerLayout

에러

221

이수진

작성한 질문수 5

0

Unable to start activity ComponentInfo{com.cartris.a1201_draw_layout/com.cartris.a1201_draw_layout.DrawLayoutActivity}: android.view.InflateException: Binary XML file line #15 in com.cartris.a1201_draw_layout:layout/activity_draw_layout: Binary XML file line #19 in com.cartris.a1201_draw_layout:layout/content_draw_layout: Error inflating class fragment

이런 에러가 뜹니다 왜 그런걸까요??


activity_draw_layout 에 있는 코드 내용은 아래와 같습니다
<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">

<include
android:id="@+id/app_bar_draw_layout"
layout="@layout/app_bar_draw_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

<com.google.android.material.navigation.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_draw_layout"
app:menu="@menu/activity_draw_layout_drawer" />
</androidx.drawerlayout.widget.DrawerLayout>

content_draw_layout 에 있는 코드 내용은 아래와 같습니다

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:showIn="@layout/app_bar_draw_layout">

<fragment
android:id="@+id/nav_host_fragment_content_draw_layout"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="true"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:navGraph="@navigation/mobile_navigation" />
</androidx.constraintlayout.widget.ConstraintLayout>
 

java android

답변 1

0

이수진

1번 에러를 보고 content_draw_layout에서 <fragment <androidx.fragment.app.FragmentContainerView로 변경했는데 그 이후에 

1번 에러를 보고 content_draw_layout에서 <fragment <androidx.fragment.app.FragmentContainerView로 변경했는데 그 이후에 does not have a NavController set on 2131231021

 

이런 에러가 또 납니다..

PPT 자료 공유 받을 수 있을까요?

0

6

1

툴바 타이틀 폰트 설정하는거 어떻게 하나요...

0

361

1

버튼에 백그라운드 이미지 설정 후 클릭 시 이벤트 처리

0

455

1

액션바를 제거하고 버튼으로 배치해서 옵션 메뉴를 구성하고 싶습니다

0

422

1

갤러리에서 이미지 가져오기가 안됩니다.

0

514

1

getExternalStoragePublicDirectory() 안드로이드 10

0

1008

3

디렉토리

0

296

4

썸네일

0

256

1

강의ppt공유가능하실까요

0

175

1

소스코드 마지막강좌에 게시부탁드립니다

0

194

1

리스트 뷰 네트워크 동기 할때 오류 관련 질문 드립니다.

0

317

1

네트워크가 다를경우 서버와접속이 불가능한가요?

0

226

2

getPackagename()함수가 작동 안할때 가 있을까요.

0

228

1

쓰레드 질문 입니다.

0

368

4

강좌 순서에서 맨 마지막 소스코드들어가봤는데 파일이 없습니다.

0

261

2

전역변수를 클레스 매서드에서 사용할때.

0

305

2

액션바 커스터 마이징 할때 한 다음에 여기에 팝업메뉴 추가 가능한가요...

0

217

2

해결안되는 에러.. Failed to find configured root that contains /null/

0

2584

2

manifest에 프로바이더 네임 이 바꼈다고 합니다.

1

729

1

post방식으로 배열 데이터 넘길때 질문 입니다.

0

745

2

16:47 부분에 질문 있습니다.

0

190

1

getExternalStorageDirectory 함수가 없어요

0

290

1

E/SchedPolicy: set_timerslack_ns write failed: Operation not permitted

0

720

1

영상이 잘못올라왔네요

0

116

1