title: cannot resolve symbol AlertDialog
body: <p>This is the code in which i used AlertDialog, and it says symbol cant be resolved? how to resolve this error? what is the alternative for this?
  and can anyone suggest a good and working tutorial for mysql php android ?
  thanks in advance!!</p>
  
  <pre><code>public class BackgroundWorker extends AsyncTask&lt;String,Void,String&gt; {
  Context context;
  AlertDialog alertDialog;
  BackgroundWorker (Context ctx) {
      context = ctx;
  }
  @Override
  protected String doInBackground(String... params) {
      String type = params[0];
      String login_url = "http://192.168.1.6/login.php";
      if(type.equals("login")) {
          try {
              String user_name = params[1];
              String password = params[2];
              URL url = new URL(login_url);
              HttpURLConnection httpURLConnection = (HttpURLConnection)url.openConnection();
              httpURLConnection.setRequestMethod("POST");
              httpURLConnection.setDoOutput(true);
              httpURLConnection.setDoInput(true);
              OutputStream outputStream = httpURLConnection.getOutputStream();
              BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(outputStream, "UTF-8"));
              String post_data = URLEncoder.encode("user_name","UTF-8")+"="+URLEncoder.encode(user_name,"UTF-8")+"&amp;"
                      +URLEncoder.encode("password","UTF-8")+"="+URLEncoder.encode(password,"UTF-8");
              bufferedWriter.write(post_data);
              bufferedWriter.flush();
              bufferedWriter.close();
              outputStream.close();
              InputStream inputStream = httpURLConnection.getInputStream();
              BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream,"iso-8859-1"));
              String result="";
              String line="";
              while((line = bufferedReader.readLine())!= null) {
                  result += line;
              }
              bufferedReader.close();
              inputStream.close();
              httpURLConnection.disconnect();
              return result;
          } catch (MalformedURLException e) {
              e.printStackTrace();
          } catch (IOException e) {
              e.printStackTrace();
          }
      }
      return null;
  }
  
  @Override
  protected void onPreExecute() {
      alertDialog = new AlertDialog.Builder(context).create();
      alertDialog.setTitle("Login Status");
  }
  
  @Override
  protected void onPostExecute(String result) {
      alertDialog.setMessage(result);
      alertDialog.show();
  }
  
  @Override
  protected void onProgressUpdate(Void... values) {
      super.onProgressUpdate(values);
  }
  </code></pre>
  
  <p>}</p>