title: Error:(56, 21) error: non-static method getId() cannot be referenced from a static context
body: <p>I am writing this code and it shows the error non-static method <code>getID()</code> cannot be referenced from a static context.
  The error is in switch <code>(View.getID())</code> </p>
  
  <pre><code>public class MainActivity extends AppCompatActivity implements View.OnClickListener {
  
  Button greetbutton;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      greetbutton = (Button) findViewById(R.id.greetbutton);
      greetbutton.setOnClickListener(this);
  }
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.menu_main, menu);
      return true;
  }
  
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
      // Handle action bar item clicks here. The action bar will
      // automatically handle clicks on the Home/Up button, so long
      // as you specify a parent activity in AndroidManifest.xml.
      int id = item.getItemId();
  
      //noinspection SimplifiableIfStatement
      if (id == R.id.action_settings) {
          return true;
      }
  
      return super.onOptionsItemSelected(item);
  }
  
  @Override
  public void onClick(View v) {
  
      TextView textView  = (TextView) findViewById(R.id.textView);
  
      EditText editFreindname = (EditText) findViewById(R.id.editFriendname);
  
      String freindname    = editFreindname.getText().toString();
  
      switch (View.getId()) {
  
          case R.id.greetbutton:
  
              textView.setText(getString(R.string.greetstring) + freindname + "!");
  
              break;
  
          default:
  
              break;
      }
  
  }
  }
  </code></pre>