Skip to content

Instantly share code, notes, and snippets.

@viztushar
Created October 7, 2017 12:46
Show Gist options
  • Save viztushar/ffa8c49ab9bb308219273602e5b479eb to your computer and use it in GitHub Desktop.
Save viztushar/ffa8c49ab9bb308219273602e5b479eb to your computer and use it in GitHub Desktop.
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.viztushar.urbanwalls/com.viztushar.urbanwalls.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.view.View.getPaddingLeft()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2659)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2724)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1473)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6123)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.view.View.getPaddingLeft()' on a null object reference
at com.mikepenz.materialdrawer.AccountHeaderBuilder.build(AccountHeaderBuilder.java:793)
at com.viztushar.urbanwalls.MainActivity.onCreate(MainActivity.java:282)
at android.app.Activity.performCreate(Activity.java:6672)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1140)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2612)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2724) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1473) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6123) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757) 
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="178dp"
android:background="@color/colorPrimary"
android:orientation="vertical"
android:weightSum="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:orientation="vertical">
<TextView
android:id="@+id/drawer_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:text="@string/app_name"
android:textSize="18sp"
android:textColor="#fff"
android:textStyle="bold" />
</LinearLayout>
<ImageView
android:id="@+id/drawer_icon"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="38dp"
android:scaleType="centerCrop"
android:src="@mipmap/ic_launcher"
android:layout_marginStart="16dp" />
</RelativeLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment