내 app
에서 나는 big view
이 약 150dp
인 사용자 정의 notification
을 구축 중입니다. 사용자 정의 알림에서 간단한보기를 포함 할 수 없습니까?
layout
View
구성 요소가
notification
기능을 만들 때 충돌하는
app
를 일으키는
<RelativeLayout 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" >
<ImageView
android:id="@+id/imagenotileft"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/imagenotileft" />
<View
android:id="@+id/view"
android:layout_width="365dp"
android:layout_height="@dimen/dp_2"
android:layout_marginTop="@dimen/dp_23"
android:layout_centerHorizontal="true"
android:layout_below="@+id/title"
android:background="@color/comunica_app_light_grey" />
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/view"
android:layout_toRightOf="@+id/imagenotileft" />
<ImageView
android:id="@+id/imagenotiright"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:padding="10dp" />
</RelativeLayout>
아래에 주어진다는 완벽하게 View
구성 요소없이 팽창 때문에 called.There가 code
부분 아무 문제 없습니다입니다.
오류가 발생한 동안의 로그는 다음과 같습니다.
Unrecognized GLES max version string in extensions: ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1
12-21 10:27:36.504 1701-1701/? E/StatusBar: couldn't inflate view for notification edu.uoc.app.comunica.dev/0x0
android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class android.view.View
Caused by: android.view.InflateException: Binary XML file line #0: Error inflating class android.view.View
Caused by: android.view.InflateException: Binary XML file line #0: Class not allowed to be inflated android.view.View
at android.view.LayoutInflater.failNotAllowed(LayoutInflater.java:683)
at android.view.LayoutInflater.createView(LayoutInflater.java:634)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:700)
at com.android.internal.policy.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:68)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:717)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:785)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:858)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
at android.view.LayoutInflater.inflate(LayoutInflater.java:518)
at android.view.LayoutInflater.inflate(LayoutInflater.java:426)
at android.widget.RemoteViews.inflateView(RemoteViews.java:3198)
at android.widget.RemoteViews.apply(RemoteViews.java:3162)
at com.android.systemui.statusbar.BaseStatusBar.inflateViews(BaseStatusBar.java:1667)
at com.android.systemui.statusbar.BaseStatusBar.createNotificationViews(BaseStatusBar.java:2171)
at com.android.systemui.statusbar.phone.PhoneStatusBar.addNotification(PhoneStatusBar.java:1407)
at com.android.systemui.statusbar.BaseStatusBar$7$2.run(BaseStatusBar.java:634)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
12-21 10:27:36.528 29283-29283/edu.uoc.app.comunica.dev E/AndroidRuntime: FATAL EXCEPTION: main
Process: edu.uoc.app.comunica.dev, PID: 29283
android.app.RemoteServiceException: Bad notification posted from package edu.uoc.app.comunica.dev: Couldn't expand RemoteViews for: StatusBarNotification(pkg=edu.uoc.app.comunica.dev user=UserHandle{0} id=0 tag=null key=0|edu.uoc.app.comunica.dev|0|null|10115: Notification(pri=0 contentView=edu.uoc.app.comunica.dev/0x7f0c002a vibrate=null sound=null tick defaults=0x0 flags=0x10 color=0x00000000 vis=PRIVATE))
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1631)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
로그에서이 문제의 원인을 파악할 수 없습니다.
해결책을 제공해주십시오.
레이아웃은 'android : layout_below = "@ + id/send_date"입니까? ,'TextView'와'View'는 왜 같은 ID입니까? –
죄송합니다. 질문은 편집되었습니다. –