android - Cannot add Button in second child in Sliding up Panel -
i have sliding panel in layout. there button in first child works fine when add button in second child there nullpointerexception thrown. if remove button layout works fine. not able understand doing wrong?
layout looks :
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <com.sothree.slidinguppanel.slidinguppanellayout xmlns:sothree="http://schemas.android.com/apk/res-auto" android:id="@+id/sliding_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="bottom" sothree:umanopanelheight="68dp" sothree:umanoshadowheight="4dp"> <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center|top" android:text="the awesome sliding panel" android:textsize="16sp" /> <button android:id="@+id/toggle_upper" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="upper" /> </linearlayout> <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <edittext android:layout_width="wrap_content" android:layout_height="wrap_content" android:hint="edit this" /> <button android:id="@+id/toggle_upper2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="upper" /> </linearlayout> </com.sothree.slidinguppanel.slidinguppanellayout> </linearlayout>
exception:
java.lang.nullpointerexception @ android.view.viewgroup_delegate.drawshadow(viewgroup_delegate.java:74) @ android.view.viewgroup_delegate.drawchild(viewgroup_delegate.java:61) @ android.view.viewgroup.drawchild(viewgroup.java:3404) @ android.view.viewgroup.dispatchdraw(viewgroup.java:3198) @ android.view.view.draw(view.java:15017) @ android.view.viewgroup.drawchild_original(viewgroup.java:3404) @ android.view.viewgroup_delegate.drawchild(viewgroup_delegate.java:53) @ android.view.viewgroup.drawchild(viewgroup.java:3404) @ com.sothree.slidinguppanel.slidinguppanellayout.drawchild(slidinguppanellayout.java:1024) @ android.view.viewgroup.dispatchdraw(viewgroup.java:3198) @ android.view.view.draw(view.java:15017) @ android.view.viewgroup.drawchild_original(viewgroup.java:3404) @ android.view.viewgroup_delegate.drawchild(viewgroup_delegate.java:53) @ android.view.viewgroup.drawchild(viewgroup.java:3404) @ android.view.viewgroup.dispatchdraw(viewgroup.java:3198) @ android.view.view.draw(view.java:15017) @ android.view.viewgroup.drawchild_original(viewgroup.java:3404) @ android.view.viewgroup_delegate.drawchild(viewgroup_delegate.java:53) @ android.view.viewgroup.drawchild(viewgroup.java:3404) @ android.view.viewgroup.dispatchdraw(viewgroup.java:3198) @ android.view.view.draw(view.java:15017) @ android.view.viewgroup.drawchild_original(viewgroup.java:3404) @ android.view.viewgroup_delegate.drawchild(viewgroup_delegate.java:53) @ android.view.viewgroup.drawchild(viewgroup.java:3404) @ android.view.viewgroup.dispatchdraw(viewgroup.java:3198) @ android.view.view.draw(view.java:15117) @ android.view.view.draw(view.java:15022) @ android.view.viewgroup.drawchild_original(viewgroup.java:3404) @ android.view.viewgroup_delegate.drawchild(viewgroup_delegate.java:53) @ android.view.viewgroup.drawchild(viewgroup.java:3404) @ android.view.viewgroup.dispatchdraw(viewgroup.java:3198) @ android.view.view.draw(view.java:15117) @ com.android.layoutlib.bridge.impl.rendersessionimpl.render(rendersessionimpl.java:587) @ com.android.layoutlib.bridge.bridge.createsession(bridge.java:334) @ com.android.ide.common.rendering.layoutlibrary.createsession(layoutlibrary.java:350) @ com.android.tools.idea.rendering.renderservice$5.compute(renderservice.java:688) @ com.android.tools.idea.rendering.renderservice$5.compute(renderservice.java:677) @ com.intellij.openapi.application.impl.applicationimpl.runreadaction(applicationimpl.java:932) @ com.android.tools.idea.rendering.renderservice.createrendersession(renderservice.java:677) @ com.android.tools.idea.rendering.renderservice.render(renderservice.java:815) @ org.jetbrains.android.uipreview.androidlayoutpreviewtoolwindowmanager.dorender(androidlayoutpreviewtoolwindowmanager.java:646) @ org.jetbrains.android.uipreview.androidlayoutpreviewtoolwindowmanager.access$1700(androidlayoutpreviewtoolwindowmanager.java:82) @ org.jetbrains.android.uipreview.androidlayoutpreviewtoolwindowmanager$7$1.run(androidlayoutpreviewtoolwindowmanager.java:589) @ com.intellij.openapi.progress.impl.progressmanagerimpl$2.run(progressmanagerimpl.java:178) @ com.intellij.openapi.progress.progressmanager.executeprocessunderprogress(progressmanager.java:209) @ com.intellij.openapi.progress.impl.progressmanagerimpl.executeprocessunderprogress(progressmanagerimpl.java:212) @ com.intellij.openapi.progress.impl.progressmanagerimpl.runprocess(progressmanagerimpl.java:171) @ org.jetbrains.android.uipreview.androidlayoutpreviewtoolwindowmanager$7.run(androidlayoutpreviewtoolwindowmanager.java:584) @ com.intellij.util.ui.update.mergingupdatequeue.execute(mergingupdatequeue.java:320) @ com.intellij.util.ui.update.mergingupdatequeue.execute(mergingupdatequeue.java:310) @ com.intellij.util.ui.update.mergingupdatequeue$2.run(mergingupdatequeue.java:254) @ com.intellij.util.ui.update.mergingupdatequeue.flush(mergingupdatequeue.java:269) @ com.intellij.util.ui.update.mergingupdatequeue.flush(mergingupdatequeue.java:227) @ com.intellij.util.ui.update.mergingupdatequeue.run(mergingupdatequeue.java:217) @ com.intellij.util.concurrency.queueprocessor.runsafely(queueprocessor.java:238) @ com.intellij.util.alarm$request$1.run(alarm.java:327) @ java.util.concurrent.executors$runnableadapter.call(executors.java:471) @ java.util.concurrent.futuretask.run(futuretask.java:262) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615) @ java.lang.thread.run(thread.java:745)
i running old version of android studio. android studio 1.0 not support preview of layout.
i updated android studio , can see layout now.
Comments
Post a Comment