title: cannot make a static reference to the non-static method findviewbyid(int) TextView
body: <p>i have this error<br>
  <code>Cannot make a static reference to the non-static method findViewById(int) from the type Activity" in a second activity</code></p>
  
  <p>Code of second activity:</p>
  
  <pre><code>public class sendQuery extends main  {
  /////////// Public method to send Query ///////////
  public static String send(String query,Activity main) {
      String result = "0";
      InputStream is = null;
      String weekDayVal=null;
      //the query to send
      ArrayList&lt;NameValuePair&gt; querySend = new ArrayList&lt;NameValuePair&gt;();
  
      querySend.add(new BasicNameValuePair("querySend",query));
  
      //http post
      try{
          HttpClient httpclient = new DefaultHttpClient();
          HttpPost httppost = new HttpPost("http://locali.altervista.org/php/locali.php");
          httppost.setEntity(new UrlEncodedFormEntity(querySend));
          HttpResponse response = httpclient.execute(httppost);
          HttpEntity entity = response.getEntity();
          is = entity.getContent();
      }catch(Exception e){
          Log.e("log_tag", "Error in http connection "+e.toString());
      }
  
      //convert response to string
      try{
          BufferedReader reader = new BufferedReader(
                  new InputStreamReader(is,"iso-8859-1"),8);
          StringBuilder sb = new StringBuilder();
          String line = null;
          while ((line = reader.readLine()) != null) {
              sb.append(line + "\n");
          }
          is.close();
          result=sb.toString();
          try{
              JSONArray weekDetails = new JSONArray ( result); // Your response string
              for(int index=0;index &lt; weekDetails.length();index++)
              {
              JSONObject tempWeekDetail = weekDetails.getJSONObject(index);
              weekDayVal = tempWeekDetail.getString("Lunedi");// Value for Monday
              //added this Log which you can view from LogCat. also changed above variable name
              Log.i("Resp Value","Moday Value "+weekDayVal);
              }
              }catch(Exception e)
              {
  
                  TextView text = (TextView) main.findViewById(R.id.textView10);
                  text.setText(weekDayVal);
              }
      }catch(Exception e){
          Log.e("log_tag", "Error converting result: "+e.toString());
      }
  
      Log.i("SendQUERY", result);
      return result;
  }
    }
  </code></pre>
  
  <p>Have I first to pass the value to main activity?<br>
  and why I get this error?<br>
  Please help me!
  Thanks</p>
  
  <p>EDIT</p>
  
  <p>I have modify code, is now correct?   because I do not see the writing in the TextView      </p>