title: alarm dialog for turn on wifi
body: <p>I am new in android programming. I searched on the internet but i can't find any solution, maybe for this i have not good english. anyway. When user clicked on the web link i want to show an alarm dialog to user that turn on wifi, and then user clicked on the OK button, wifi settings is shows.</p>
  
  <p>This is my TextView with link:</p>
  
  <pre><code>  &lt;TextView
      android:id="@+id/sitename"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="@string/site2"
      android:background="@color/white"
      android:layout_below="@id/address"
      android:layout_toLeftOf="@id/site"
      android:paddingTop="3dp"
      android:paddingRight="5dp"
      android:autoLink="web"/&gt;
  </code></pre>
  
  <p>and i set text of web with strings.xml.</p>
  
  <p>sorry if my question was duplicated and sorry for my poor english.
  Cheers.</p>
  
  <p>EDIT: Contact.java:</p>
  
  <pre><code>public class Contact extends Fragment {
  
  public String fonts="Tahoma.TTF";
  Typeface face;
  
  TextView siteName;
  
  @Override 
  public View onCreateView(LayoutInflater inflater,ViewGroup container, Bundle savedInstanceState){
      View view=inflater.inflate(R.layout.contact, container, false);
              siteName=(TextView)view.findViewById(R.id.sitename);
      siteName.setOnClickListener(onClickListener);
  
      return view;
  }
  
  private OnClickListener onClickListener=new OnClickListener(){
  
      @Override
      public void onClick(View v) {
          // TODO Auto-generated method stub
          switch(v.getId()){
          case R.id.sitename:
              AlertDialog.Builder alertDialog=new AlertDialog.Builder(getActivity());
              alertDialog.setTitle("Turn on WI-Fi..");
              alertDialog.setMessage("Do you want to go to wifi settings?");
              alertDialog.setNegativeButton("Cancle", new DialogInterface.OnClickListener() {
  
                  @Override
                  public void onClick(DialogInterface dialog, int which) {
                      // TODO Auto-generated method stub
                      dialog.cancel();
                  }
              });
              alertDialog.setPositiveButton("OK", new DialogInterface.OnClickListener() {
  
                  @Override
                  public void onClick(DialogInterface dialog, int which) {
                      // TODO Auto-generated method stub
                      startActivity(new Intent(WifiManager.ACTION_PICK_WIFI_NETWORK));
                  }
              });
  
              alertDialog.show();
  
              break;
          }
      }
  
  };
   }
  </code></pre>