title: Error in running android app
body: <p>i just started <code>Android Studio</code> and i am having error as i try to run my app.This is the error message i got:</p>
  
  <pre><code>Error:(53, 58) error: method getId in class View cannot be applied to given types;
  required: no arguments
  found: int
  reason: actual and formal argument lists differ in length
  Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
  </code></pre>
  
  <blockquote>
    <p>Compilation failed; see the compiler error output for details.</p>
  </blockquote>
  
  <p>My java code are below:</p>
  
  <pre><code>package com.ekesoft.myapplication;
  
  import android.os.Bundle;
  import android.support.design.widget.FloatingActionButton;
  import android.support.design.widget.Snackbar;
  import android.support.v7.app.AppCompatActivity;
  import android.support.v7.widget.Toolbar;
  import android.view.View;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.widget.RelativeLayout;
  import android.widget.Button;
  import android.graphics.Color;
  import android.widget.EditText;
  
  public class MainActivity extends AppCompatActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          //Layout
          RelativeLayout ekeLayout = new RelativeLayout(this);
          ekeLayout.setBackgroundColor(Color.BLUE);
  
          //Button
          Button redButton = new Button(this);
          redButton.setBackgroundColor(Color.GRAY);
          redButton.setText("Log in");
  
          //User name field
          EditText Username = new EditText(this);
          Username.setBackgroundColor(Color.WHITE);
  
  
          redButton.setId(2);
          Username.setId(3);
  
  
          //Creat a container for our layout
          RelativeLayout.LayoutParams ekedetail = new RelativeLayout.LayoutParams(
                  RelativeLayout.LayoutParams.WRAP_CONTENT,
                  RelativeLayout.LayoutParams.WRAP_CONTENT
  
          );
          RelativeLayout.LayoutParams Userdetail = new RelativeLayout.LayoutParams(
                  RelativeLayout.LayoutParams.WRAP_CONTENT,
                  RelativeLayout.LayoutParams.WRAP_CONTENT
  
          );
  
          //Set rules to position widget
          Userdetail.addRule(RelativeLayout.ABOVE,redButton.getId(2));
          Userdetail.addRule(RelativeLayout.CENTER_VERTICAL);
          Userdetail.setMargins(0,0,0,100);
  
  
  
          //Set the position of our container
          ekedetail.addRule(RelativeLayout.CENTER_HORIZONTAL);
          ekedetail.addRule(RelativeLayout.CENTER_VERTICAL);
  
  
  
          //Add widget to the layout, is now a child of the layout
          ekeLayout.addView(redButton,ekedetail);
          ekeLayout.addView(Username,Userdetail);
  
          //Set this as the content to be displayed
          setContentView(ekeLayout);
  
      }
  
      @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);
      }
  
  }
  </code></pre>
  
  <p>My aim was to build simple interface using java. </p>