First time here? Check out the FAQ!
x

How to add an include layout in coordinator layout in Android Studio?

0 votes
asked by about Android Studio
edited by

Hello,

I created two XML activities. One is for the activity interface layout and another one is the for the coordinator layout. I added the include layout for the interface layout activity into the coordinator layout and I can't see my interface layout from the preview. The preview is blank and these are the errors they are showing me:

*************************************************

Error 1: RENDER PROBLEMS

<item> tag requires a 'drawable' attribute or child tag defining a drawable
_______________________________________________________________________________

Error 2: can't make a decor toolbar out of relative layout

java.lang.IllegalStateException: Can't make a decor toolbar out of RelativeLayout
at android.support.v7.widget.ActionBarOverlayLayout.getDecorToolbar(ActionBarOverlayLayout.java:549)
at android.support.v7.widget.ActionBarOverlayLayout.pullChildren(ActionBarOverlayLayout.java:538)
at android.support.v7.widget.ActionBarOverlayLayout.onMeasure_Original(ActionBarOverlayLayout.java:339)
at android.support.v7.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java)
at android.view.View.measure_Original(View.java:22071)
at android.view.View_Delegate.measure(View_Delegate.java:80)
at android.view.View.measure(View.java:22035)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461)
at android.view.View.measure_Original(View.java:22071)
at android.view.View_Delegate.measure(View_Delegate.java:80)
at android.view.View.measure(View.java:22035)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.measureView(RenderSessionImpl.java:590)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:343)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:384)
at com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:193)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:544)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$3(RenderTask.java:678)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

1 Answer

0 votes
answered by (236k points)

You will have to check the available websites listed on the Google Search to find out about the way you implement the layout in the coordinator layout.

Luckily, there are plenty websites and videos that can teach you how to work with the Android Studio. I highly recommend checking the websites listed on the following page.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register
...