title: Caused by: java.lang.ClassCastException: android.widget.TextView cannot be cast to android.widget.EditText
body: <p>I tried clean project and even rebuild project, there is no change .... The application has stop, and the log error is :
  <a href="https://i.stack.imgur.com/dOaTd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dOaTd.png" alt="enter image description here"></a></p>
  
  <pre><code>package com.example.dota.jsonphp;
  
  import android.app.Activity;
  import android.os.AsyncTask;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.Button;
  import android.widget.EditText;
  
  import java.io.BufferedReader;
  import java.io.IOException;
  import java.io.InputStream;
  import java.io.InputStreamReader;
  import java.net.HttpURLConnection;
  import java.net.MalformedURLException;
  import java.net.URL;
  
  public class MainActivity extends Activity implements View.OnClickListener
  {
     private EditText textview1;
     private Button btnhit;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          textview1 = (EditText) findViewById(R.id.textview);
          btnhit = (Button) findViewById(R.id.btnhit);
          btnhit.setOnClickListener(this);
      }
  
      @Override
      public void onClick(View v) {
          new jsontask().execute("http://localhost/phppage.php");
      }
  
  
      public class jsontask extends AsyncTask&lt;String, String, String&gt; {
  
  
          @Override
          protected String doInBackground(String... params) {
              HttpURLConnection connection = null;
              BufferedReader reader = null;
              try {
                  URL url = new URL(params[0]);
                  connection = (HttpURLConnection) url.openConnection();
                  connection.connect();
  
                  InputStream stream = connection.getInputStream();
                  reader = new BufferedReader(new InputStreamReader(stream));
  
                  StringBuffer buffer = new StringBuffer();
                  String line = "";
                  while ((line = reader.readLine()) != null) {
                      buffer.append(line);
  
                  }
                  return buffer.toString();
  
  
              } catch (MalformedURLException e) {
                  e.printStackTrace();
              } catch (IOException e) {
                  e.printStackTrace();
              } finally {
                  if (connection != null) {
                      connection.disconnect();
                  }
                  try {
                      if (reader != null) {
                          reader.close();
                      }
                  } catch (IOException e) {
                      e.printStackTrace();
                  }
  
              }
              return null;
          }
  
          @Override
          protected void onPostExecute(String result) {
              super.onPostExecute(result);
              textview1.setText(result);
          }
  
      }
  
  
  }
  </code></pre>
  
  <p>Layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent"
      android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingTop="@dimen/activity_vertical_margin"
      android:paddingBottom="@dimen/activity_vertical_margin"
      app:layout_behavior="@string/appbar_scrolling_view_behavior"
      tools:showIn="@layout/activity_main" tools:context=".MainActivity"
      android:orientation="vertical"
      android:weightSum="1"&gt;
  
          &lt;TextView
              android:id="@+id/textview"
              android:layout_width="265dp"
              android:layout_height="wrap_content"
              android:text="helloworld"
              /&gt;
          &lt;Button
              android:layout_width="100dp"
              android:layout_height="wrap_content"
              android:id="@+id/btnhit"
              android:text="HIt"
              android:layout_weight="0.06" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>