title: BluetoothLeScanner doesn't scan; No idea if bug is in software or in my code
body: <p>so I tried implementing a BLE Scanner. The only thing is I couldn't get it to give me any output. Here is my code:</p>
  
  <p><strong>MainActivity.java</strong></p>
  
  <pre><code>    public class MainActivity extends Activity
  
       {
      @Override
      protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
          //Creating the BTManager and the BTAdapter
          final BluetoothManager bluetoothManager =(BluetoothManager)getSystemService(Context.BLUETOOTH_SERVICE);
          final BluetoothAdapter bluetoothAdapter = bluetoothManager.getAdapter();
          final BluetoothLeScanner bluetoothLeScanner = bluetoothAdapter.getBluetoothLeScanner();
  
  
          Button scanButton = (Button)findViewById(R.id.scanButton);
          Button locateButton = (Button)findViewById(R.id.locateButton);
  
      /* Ensures Bluetooth is available on the device and it is enabled. If not,
      displays a dialog requesting user permission to enable Bluetooth.*/
      if( bluetoothAdapter == null || bluetoothAdapter.isEnabled()) {
          Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
          startActivityForResult(enableBtIntent, 1);
      }
  
          scanButton.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  StartScan(bluetoothLeScanner);
              }
          });
  
          locateButton.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  Locate();
              }
          });
  
  
  }
  
  
  
     public void StartScan(final BluetoothLeScanner bluetoothLeScanner) {
      //Perform the Scan actions here
      Log.v("Scan","Has Started");
  
      ScanSettings scanSettings = new ScanSettings.Builder().setScanMode(ScanSettings.SCAN_MODE_BALANCED).build();
  
      final ScanCallback scanCallback = new ScanCallback() {
          @Override
          public void onScanResult(int callbackType, ScanResult result)
          {
              String new_result = result.toString();
              Log.v(new_result, "Visible?");
              TextView textView = (TextView)findViewById(R.id.textView);
              textView.setText(new_result);
          }
  
          @Override
          public void onScanFailed(int errorCode)
          {
              super.onScanFailed(errorCode);
              Log.e("Error","Error Occurred");
          }
      };
  
      //The list for the filters
      ArrayList&lt;ScanFilter&gt; filters= new ArrayList&lt;&gt;();
  
      //mac addresses of ble devices
      String[] filterList = {"D4:B4:C8:7E:D1:35","00:1A:7D:DA:71:11","58:49:BA:0D:69:2A"};
  
      //Adding the MAC addresses to the filters list
      for(int i=0; i&lt; filterList.length ; i++) {
          ScanFilter filter = new ScanFilter.Builder().setDeviceAddress(filterList[i]).build();
          filters.add(filter);
  
      }
  
  
      bluetoothLeScanner.startScan(filters, scanSettings, scanCallback);
  
      Handler handler = new Handler();
      int scanPeriod = 60000;
      handler.postDelayed(new Runnable() {
          @Override
          public void run() {
              bluetoothLeScanner.stopScan(scanCallback);
          }
      },scanPeriod);
  
  }
  
  public void Locate() {
      //Perform the Locate actions here
      Toast.makeText(MainActivity.this, "Locate Started", Toast.LENGTH_LONG).show();
  
  }
  }
  </code></pre>
  
  <p><strong>activity_main.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:id="@+id/activity_main"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:paddingBottom="@dimen/activity_vertical_margin"
  android:paddingLeft="@dimen/activity_horizontal_margin"
  android:paddingRight="@dimen/activity_horizontal_margin"
  android:paddingTop="@dimen/activity_vertical_margin"
  tools:context="teamfour.bluetoothtracker.MainActivity"&gt;
  
  &lt;Button
      android:layout_width="75pt"
      android:layout_height="wrap_content"
      android:id="@+id/scanButton"
      android:text="Scan"/&gt;
  
  &lt;Button
      android:layout_width="75pt"
      android:layout_height="wrap_content"
      android:id="@+id/locateButton"
      android:text="Locate"
      android:layout_alignParentTop="true"
      android:layout_alignParentEnd="true" /&gt;
  
  &lt;TextView
      android:text="TextView"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_below="@+id/scanButton"
      android:layout_centerHorizontal="true"
      android:layout_marginTop="59dp"
      android:id="@+id/textView" /&gt;
  
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Can you guys figure out what I am doing wrong? Or is it the software which prevents me from getting any output ?</p>