title: No errors but app is not working Android studio
body: <p>I'm trying to scan Access Points and list them. When I'm trying to run it in emulator, there is no error but app stop working message come to screen. I tried generate APK and start on real phone app cannot install to the phone.</p>
  
  <p>This my code:</p>
  
  <pre><code>package com.ahmet.apscan;
  import android.app.Activity;
  import android.content.BroadcastReceiver;
  import android.content.Context;
  import android.content.Intent;
  import android.content.IntentFilter;
  import android.net.wifi.ScanResult;
  import android.net.wifi.WifiManager;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.View;
  import android.widget.ArrayAdapter;
  import android.widget.Button;
  import android.widget.ListView;
  import android.widget.TextView;
  import android.widget.Toast;
  
  import java.util.ArrayList;
  import java.util.List;
  
  public class MainActivity extends Activity implements View.OnClickListener{
  
  
      WifiManager wifi;
      ListView lv;
      Button buttonScan;
      int size = 0;
      List&lt;ScanResult&gt; results;
  
      String ITEM_KEY = "key";
      ArrayList&lt;String&gt; arraylist = new ArrayList&lt;&gt;();
      ArrayAdapter adapter;
  
      /* Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState)
      {
          super.onCreate(savedInstanceState);
          getActionBar().setTitle("Widhwan Setup Wizard");
  
          setContentView(R.layout.activity_main);
  
          buttonScan = (Button) findViewById(R.id.scan);
          buttonScan.setOnClickListener(this);
          lv = (ListView)findViewById(R.id.wifilist);
  
  
          wifi = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE);
          if (wifi.isWifiEnabled() == false)
          {
              Toast.makeText(getApplicationContext(), "wifi is disabled..making it enabled", Toast.LENGTH_LONG).show();
              wifi.setWifiEnabled(true);
          }
          this.adapter =  new ArrayAdapter&lt;&gt;(this,android.R.layout.simple_list_item_1,arraylist);
          lv.setAdapter(this.adapter);
  
          scanWifiNetworks();
      }
  
      public void onClick(View view)
      {
          scanWifiNetworks();
      }
  
      private void scanWifiNetworks(){
  
          arraylist.clear();
          registerReceiver(wifi_receiver, new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION));
  
          wifi.startScan();
  
          Log.d("WifScanner", "scanWifiNetworks");
  
          Toast.makeText(this, "Scanning....", Toast.LENGTH_SHORT).show();
  
      }
  
      BroadcastReceiver wifi_receiver= new BroadcastReceiver()
      {
  
          @Override
          public void onReceive(Context c, Intent intent)
          {
              Log.d("WifScanner", "onReceive");
              results = wifi.getScanResults();
              size = results.size();
              unregisterReceiver(this);
  
              try
              {
                  while (size &gt;= 0)
                  {
                      size--;
                      arraylist.add(results.get(size).SSID);
                      adapter.notifyDataSetChanged();
                  }
              }
              catch (Exception e)
              {
                  Log.w("WifScanner", "Exception: "+e);
  
              }
  
  
          }
      };
  
  }
  </code></pre>
  
  <p>And this is my Xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:padding="10dp"
  android:layout_width="match_parent"
  android:layout_height="match_parent"&gt;
  
  &lt;ListView
      android:id="@+id/wifilist"
      android:layout_width="match_parent"
      android:layout_height="312dp"
      android:layout_weight="0.97" /&gt;
  
  
  &lt;Button
      android:id="@+id/scan"
      android:layout_width="match_parent"
      android:layout_height="50dp"
      android:layout_gravity="bottom"
      android:layout_margin="15dp"
      android:background="@android:color/holo_green_light"
      android:text="Scan Again" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>This is my logcat:</p>
  
  <pre><code>10-25 14:56:19.808 2010-4163/? I/GCoreUlr: Starting service, intent=Intent {                             act=com.google.android.location.reporting.ACTION_UPDATE_WORLD cmp=com.google.android.gms/com.google.android.location.reporting.service.DispatchingService (has extras) }, extras=Bundle[{receiverAction=com.google.android.location.reporting.PHENOTYPE_FLAGS_CHANGED}]
  10-25 14:56:19.812 2010-4137/? I/GCoreUlr: WorldUpdater received intent Intent { act=com.google.android.location.reporting.ACTION_UPDATE_WORLD cmp=com.google.android.gms/com.google.android.location.reporting.service.DispatchingService (has extras) } with receiverAction com.google.android.location.reporting.PHENOTYPE_FLAGS_CHANGED
  10-25 14:56:19.813 2010-4137/? E/GCoreUlr: Bad errorId configuring silent feedback
  10-25 14:56:19.814 2010-4137/? I/GCoreUlr: WorldUpdater:com.google.android.location.reporting.PHENOTYPE_FLAGS_CHANGED: Ensuring that reporting is stopped because of reasons: (no Google accounts)
  10-25 14:56:19.817 2010-4137/? I/GCoreUlr: Unbound from all location providers
  10-25 14:56:19.817 2010-4137/? I/GCoreUlr: Place inference reporting - stop
  10-25 14:56:19.819 2010-2010/? I/GCoreUlr: DispatchingService.onDestroy()
  10-25 14:56:19.819 2010-2010/? I/GCoreUlr: Stopping handler for UlrDispSvcFast
  10-25 14:56:19.822 2010-2010/? I/GCoreUlr: Unbound from all location providers
  10-25 14:56:19.822 2010-2010/? I/GCoreUlr: Place inference reporting - stop
  </code></pre>
  
  <p>How can I fix this Bad errorId configuring silent feedback?</p>
  
  <p>Now I tried Clean Project &amp; Make Project. After that I build new Emulator and 
  logcat changed like this;</p>
  
  <pre><code>10-25 15:21:22.302 4752-4752/? I/art: Not late-enabling -Xcheck:jni (already on)
  10-25 15:21:22.302 4752-4752/? W/art: Unexpected CPU variant for X86 using defaults: x86
  10-25 15:21:22.317 4752-4759/? E/art: Failed sending reply to debugger: Broken pipe
  10-25 15:21:22.317 4752-4759/? I/art: Debugger is no longer active
  10-25 15:21:22.317 4752-4759/? I/art: Starting a blocking GC Instrumentation
  10-25 15:21:22.391 4752-4752/? W/System: ClassLoader referenced unknown path: /data/app/com.ahmet.apscan-2/lib/x86
  10-25 15:21:22.396 4752-4752/? I/InstantRun: starting instant run server: is main process
  10-25 15:21:22.414 4752-4752/? D/AndroidRuntime: Shutting down VM
  10-25 15:21:22.414 4752-4752/? E/AndroidRuntime: FATAL EXCEPTION: main
                                                   Process: com.ahmet.apscan, PID: 4752
                                                   java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ahmet.apscan/com.ahmet.apscan.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.ActionBar.setTitle(java.lang.CharSequence)' 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:866)
                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
                                                    Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.ActionBar.setTitle(java.lang.CharSequence)' on a null object reference
                                                       at com.ahmet.apscan.MainActivity.onCreate(MainActivity.java:41)
                                                       at android.app.Activity.performCreate(Activity.java:6662)
                                                       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:866) 
                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756) 
  </code></pre>