Repository: rey5137/material

Issue #217: Rendering Problems in xml - unable to view the layout in xml
Created: 2015-08-12T18:10:06Z
More Information:
Using Android Studio 1.3
Version 1.0.0
XML - when trying to view the preview unable to preview and the message displays is
Rendering Problems
java.lang.NullPointerException
at com.rey.material.app.ThemeManager.registerOnThemeChangedListener(ThemeManager.java:181)
at com.rey.material.widget.Button.onAttachedToWindow(Button.java:73)
at android.view.View.dispatchAttachedToWindow(View.java:13525)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2695)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2695)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2695)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2695)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2695)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2695)
at android.view.AttachInfo_Accessor.setAttachInfo(AttachInfo_Accessor.java:42)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:422)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:321)
at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:350)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:511)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:499)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:888)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:499)
at com.android.tools.idea.rendering.RenderTask.access$600(RenderTask.java:72)
at com.android.tools.idea.rendering.RenderTask$3.call(RenderTask.java:611)
at com.android.tools.idea.rendering.RenderTask$3.call(RenderTask.java:608)
at com.android.tools.idea.rendering.RenderService.runRenderAction(RenderService.java:363)
at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:608)
at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:630)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.doRender(AndroidLayoutPreviewToolWindowManager.java:643)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.access$1700(AndroidLayoutPreviewToolWindowManager.java:80)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7$1.run(AndroidLayoutPreviewToolWindowManager.java:585)
at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:152)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:452)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:402)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:137)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7.run(AndroidLayoutPreviewToolWindowManager.java:580)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310)
at com.intellij.util.ui.update.MergingUpdateQueue$2.run(MergingUpdateQueue.java:254)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:269)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:227)
at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:217)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:351)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)

Duplicate issue #208:  java.lang.NullPointerException  at com.rey.material.app.ThemeManager class
Created: 2015-07-31T05:45:07Z
My application is crash when startup.
My App Layout like this:

<com.rey.material.widget.Button
android:id="@+id/button_bt_flat_color"
android:layout_width="0dp"
android:layout_height="@dimen/bt_height"
android:layout_weight="0.4"
android:text="BUTTON"
android:background="@null"
app:v_styleId="@array/button_flat_color"/>

Would you tell me how to fix below error log.
java.lang.NullPointerException
        at com.rey.material.app.ThemeManager.registerOnThemeChangedListener(ThemeManager.java:181)
        at com.rey.material.widget.Button.onAttachedToWindow(Button.java:72)
        at android.view.View.dispatchAttachedToWindow(View.java:13522)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2671)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2671)
        at android.view.ViewGroup.addViewInner(ViewGroup.java:3809)
        at android.view.ViewGroup.addViewInLayout(ViewGroup.java:3746)
        at android.widget.ListView.setupChild(ListView.java:1863)
        at android.widget.ListView.makeAndAddView(ListView.java:1816)
        at android.widget.ListView.fillDown(ListView.java:697)
        at android.widget.ListView.fillFromTop(ListView.java:763)
        at android.widget.ListView.layoutChildren(ListView.java:1641)
        at android.widget.AbsListView.onLayout(AbsListView.java:2563)
        at android.view.View.layout(View.java:15762)
        at android.view.ViewGroup.layout(ViewGroup.java:4867)
        at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1055)
        at android.view.View.layout(View.java:15762)
        at android.view.ViewGroup.layout(ViewGroup.java:4867)
        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
        at android.view.View.layout(View.java:15762)
        at android.view.ViewGroup.layout(ViewGroup.java:4867)
        at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1677)
        at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1531)
        at android.widget.LinearLayout.onLayout(LinearLayout.java:1440)
        at android.view.View.layout(View.java:15762)
        at android.view.ViewGroup.layout(ViewGroup.java:4867)
        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
        at android.view.View.layout(View.java:15762)
        at android.view.ViewGroup.layout(ViewGroup.java:4867)
        at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2356)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2069)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1254)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6637)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:814)
        at android.view.Choreographer.doCallbacks(Choreographer.java:614)
        at android.view.Choreographer.doFrame(Choreographer.java:584)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:800)
        at android.os.Handler.handleCallback(Handler.java:733)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:146)
        at android.app.ActivityThread.main(ActivityThread.java:5602)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:515)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
        at dalvik.system.NativeStart.main(Native Method)

Closing comment (2015-12-11T04:28:04Z): Duplicate of #217