How can I draw a circle and scan an access point with a touch event
<p>I need to make an app to draw a circle with a touch event, and to scan the Acces Point using the Wifimanager class. The class for drawing works fine but when I add the w.setWifiEnable the app stops working. What can I do for this?</p>

<p>package com.ejemplo.demo;</p>

<pre><code>public class DrawFunny extends Activity implements OnTouchListener  {
private float x;
private float y;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    MyCustomPanel view = new MyCustomPanel(this);

    ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT);
    addContentView(view, params);
    view.setOnTouchListener(this);


    WifiManager w = (WifiManager) getSystemService(Context.WIFI_SERVICE);  
    w.setWifiEnabled(true); //***************This dont Work **********                 

}
private class MyCustomPanel extends View {

    public MyCustomPanel(Context context) {
        super(context);

    }
    @Override
    public void draw(Canvas canvas) {

        Paint paint = new Paint();
        paint.setColor(Color.BLUE);
        paint.setAntiAlias(true);
        canvas.drawCircle(x,y,3,paint);

    }
}

public boolean onTouch(View v, MotionEvent event) {
    x = event.getX();
    y = event.getY();

    v.invalidate();
    return true;
}
</code></pre>

<p>}</p>
