android wifi application crash
<p>I have this code:</p>

<pre><code>    List&lt;ScanResult&gt; vAll = null;
    WifiManager vMainWifi = null;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_wi_fi);

        vMainWifi = (WifiManager) this.getSystemService(Context.WIFI_SERVICE);
        vAll = getWiFi();
    }   
    public void btnViewWiFI_onClick(View v) {
        TextView vTmpTextView = (TextView) findViewById(R.id.tvRetele);
        String vString = "WiFi:";
        List&lt;String&gt; vLista = getWiFiString();
        if (vLista != null) {
            for (int i = 0; i &lt; vLista.size(); i++)
                vString += "\n\t" + vLista.get(i);
        }
        vTmpTextView.setText(vString);
    }
    List&lt;ScanResult&gt; getWiFi() {
        if (vAll != null)
            return vAll;
        if (vMainWifi.isWifiEnabled())
            return vMainWifi.getScanResults();
        else {
            vMainWifi.setWifiEnabled(true);
            return vMainWifi.getScanResults();
        }
    }
    List&lt;String&gt; getWiFiString() {
        List&lt;String&gt; vTmp = null;
        if (vAll == null)
            vAll = getWiFi();
        if (vAll != null) {
            for (int i = 0; i &lt; vAll.size(); i++)
                vTmp.add(vAll.get(i).BSSID + ", " + vAll.get(i).SSID);
        }
        return vTmp;
    }
</code></pre>

<p>In layout xml </p>

<pre><code>    &lt;TextView
        android:id="@+id/tvRetele"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="94dp" /&gt;

    &lt;Button
        android:id="@+id/btnViewWiFI"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:layout_marginLeft="145dp"
        android:layout_marginTop="233dp"
        android:onClick="btnViewWiFI_onClick"
        android:text="@string/viewWiFi" /&gt;
</code></pre>

<p>In Manifest file i have this</p>

<pre><code> &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
 &lt;uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /&gt;
 &lt;uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /&gt;
</code></pre>

<p>If I try to debug this I get empty list, probably becouse I get error for WiFi Networks, but when I upload to phone and install this application I get crash when I pres the button.
What I do wrong?</p>
