title: Unable to add logo on actionbar android
body: <p>Hello I am new to Android and I am trying to add a logo and a searchview in my actionbar of every activity. I tried to implement the logo on one of my activity but I get this error and the app crashes. Can someone tell me how to get rid of this? and is there any other way to do what I am trying to do ?</p>
  
  <p><strong>I resized the icon directly from this website</strong> <a href="https://romannurik.github.io/AndroidAssetStudio/index.html" rel="nofollow noreferrer">https://romannurik.github.io/AndroidAssetStudio/index.html</a></p>
  
  <p>Error</p>
  
  <pre><code>02-27 00:58:28.859 13851-13851/com.golstars.www.glostars E/AndroidRuntime: FATAL EXCEPTION: main
                                                                             Process: com.golstars.www.glostars, PID: 13851
                                                                             java.lang.RuntimeException: Unable to start activity ComponentInfo{com.golstars.www.glostars/com.golstars.www.glostars.MainFeed}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.app.ActionBar.setDisplayShowHomeEnabled(boolean)' on a null object reference
                                                                                 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)
                                                                                 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
                                                                                 at android.app.ActivityThread.-wrap12(ActivityThread.java)
                                                                                 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
                                                                                 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:865)
                                                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
                                                                              Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.app.ActionBar.setDisplayShowHomeEnabled(boolean)' on a null object reference
                                                                                 at com.golstars.www.glostars.MainFeed$override.onCreate(MainFeed.java:96)
                                                                                 at com.golstars.www.glostars.MainFeed$override.access$dispatch(MainFeed.java)
                                                                                 at com.golstars.www.glostars.MainFeed.onCreate(MainFeed.java:0)
                                                                                 at android.app.Activity.performCreate(Activity.java:6664)
                                                                                 at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
                                                                                 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599)
                                                                                 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707) 
                                                                                 at android.app.ActivityThread.-wrap12(ActivityThread.java) 
                                                                                 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460) 
                                                                                 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:865) 
                                                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
  </code></pre>
  
  <p>My mainfeed onCreate method </p>
  
  <pre><code>@Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main_feed);
          getSupportActionBar().setDisplayShowHomeEnabled(true);
          getSupportActionBar().setLogo(R.drawable.ic_action_logoandtext);
          getSupportActionBar().setDisplayUseLogoEnabled(true);
          Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
          setSupportActionBar(toolbar);
  </code></pre>
  
  <p>activity_main_feed.xml </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.design.widget.CoordinatorLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:fitsSystemWindows="true"
      tools:context="com.golstars.www.glostars.MainFeed"&gt;
  
  
  
      &lt;include
          layout="@layout/activity_test"
  
          /&gt;
  
      &lt;include
          layout="@layout/fabs"
          /&gt;
  
  
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p>Manifest file :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.golstars.www.glostars"&gt;
  
      &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
      &lt;uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /&gt;
      &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:debuggable="true"
          android:supportsRtl="true"
          android:name="android.support.multidex.MultiDexApplication"
          android:theme="@style/AppTheme"&gt;
          &lt;activity
              android:name=".MainActivity"
              android:label="@string/app_name"
              android:theme="@style/AppTheme.NoActionBar"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;activity
              android:name=".MainFeed"
              android:label="@string/title_activity_main_feed"
              android:theme="@style/AppTheme" /&gt;
          &lt;activity
              android:name=".user_profile"
              android:label="@string/title_activity_user_profile"
              android:theme="@style/AppTheme.NoActionBar" /&gt;
          &lt;activity
              android:name=".Fabs"
              android:theme="@style/AppTheme.NoActionBar" /&gt;
          &lt;activity
              android:name=".testfeed"
              android:label="@string/title_activity_test"
              android:theme="@style/AppTheme.NoActionBar" /&gt;
          &lt;activity
              android:name=".notification"
              android:label="@string/title_activity_notification"
              android:theme="@style/AppTheme.NoActionBar" /&gt;
          &lt;activity
              android:name=".upload"
              android:label="@string/title_activity_upload"
              android:theme="@style/AppTheme.NoActionBar" /&gt;
          &lt;activity
              android:name=".edit_profile"
              android:label="@string/title_activity_edit_profile"
              android:theme="@style/AppTheme.NoActionBar" /&gt;
          &lt;activity
              android:name=".competitionUser"
              android:label="@string/title_activity_competition_user"
              android:theme="@style/AppTheme.NoActionBar" /&gt;
          &lt;activity
              android:name=".competitionAll"
              android:label="@string/title_activity_competition_all"
              android:theme="@style/AppTheme.NoActionBar" /&gt;
          &lt;activity
              android:name=".imagefullscreen"
              android:label="@string/title_activity_image_full_screen"
              android:theme="@style/AppTheme.NoActionBar" /&gt;
          &lt;activity
              android:name=".commentModel"
              android:label="@string/title_activity_comment_model"
              android:theme="@style/AppTheme.NoActionBar"/&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>