title: How can I solve R.layout.main cannot be resolved in my android apps?
body: <p>Im new as a developer of Android apps. I find a problem. that is R.layout.main cannot be resolved. How can I solve my problem. my code is here. please solve my problem.</p>
  
  <pre><code> package com.android;
  
  import android.R;
  import android.app.Activity;
  import android.content.Intent;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.Button;
  
  public class HelloActivity extends Activity {
      /** Called when the activity is first created. */
  
      Button bt;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState); 
          setContentView(R.layout.main);
          bt=(Button)findViewById(R.id.ButtonOk);
          bt.setOnClickListener(new View.OnClickListener() {
  
              public void onClick(View v) {
                  //Toast.makeText(getBaseContext(), "Welcome Android World", 3000).show();
              Intent intent = new Intent(HelloActivity.this, DisplayActivity.class);
              startActivity(intent);
              }
          });
      }
  }
  
  
  
  
  *
  </code></pre>
  
  <blockquote>
    <p><strong>and my xml code is here:</strong></p>
  </blockquote>
  
  <p>*</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      &gt;
  &lt;TextView  
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:text="@string/hello"
      /&gt;
  &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Ok" android:id="@+id/ButtonOk" android:height="50dp" android:width="100dp"&gt;&lt;/Button&gt;
  &lt;/LinearLayout&gt;
  </code></pre>