title: “main cannot be resolved or is not a field”
body: <p>I have two errors in the code below.</p>
  
  <pre><code>setContentView(R.layout.main); 
  </code></pre>
  
  <p>The error shows that “<code>main</code> cannot be resolved or is not a field”.
  The suggested solution in Eclipse is to create field <code>main</code> in the type <code>layout</code>.</p>
  
  <pre><code>webview = (WebView) findViewById(R.id.web_engine); 
  </code></pre>
  
  <p>The error shows that “main cannot be resolved or is not a field”.
  The suggested solution in Eclipse is to create <code>web_engine</code> in type <code>id</code>.</p>
  
  <p>I tried the suggested solutions. In my <code>R.java</code>, I added a <code>main</code> in the type <code>layout</code> and a <code>web_engine</code> in the type <code>id</code>.<br>
  But the problem is not solved. Do you have any idea what can I do?</p>
  
  <p>Here is my full code.</p>
  
  <pre><code>package com.sql.greekapp;
  
  import android.app.Activity;
  import android.os.Build;
  import android.os.Bundle;
  import android.view.KeyEvent;
  import android.view.Window;
  import android.webkit.WebChromeClient;
  import android.webkit.WebSettings;
  import android.webkit.WebView;
  import android.webkit.WebViewClient;
  
  import com.sql.greekapp.R;
  
  public class GreekNewsActivity extends Activity {
      WebView webview;
  
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          this.getWindow().requestFeature(Window.FEATURE_PROGRESS);
          setContentView(R.layout.main);    
          getWindow().setFeatureInt(  Window.FEATURE_PROGRESS, Window.PROGRESS_VISIBILITY_ON); 
  
          webview = (WebView) findViewById(R.id.web_engine); 
          webview.setWebViewClient(new HelloWebViewClient());
          webview.getSettings().setJavaScriptEnabled(true); 
          webview.getSettings().setPluginsEnabled(true);  
          if (Integer.parseInt(Build.VERSION.SDK) &gt;= Build.VERSION_CODES.FROYO)
              webview.getSettings().setPluginState(WebSettings.PluginState.ON); 
          webview.getSettings().setAllowFileAccess(true);        
          webview.getSettings().setBuiltInZoomControls(true);         
          webview.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
          webview.loadUrl("http://192.168.10.250/remote"); 
  
  
  
         final Activity MyActivity = this;
         webview.setWebChromeClient(new WebChromeClient() {
         public void onProgressChanged(WebView view, int progress)   
         {
          MyActivity.setTitle("Φόρτωση...");
          MyActivity.setProgress(progress * 100); //svisimo
  
  
             if(progress == 100)
              MyActivity.setTitle(R.string.app_name);
           }
         });
  
      }
  
      private class HelloWebViewClient extends WebViewClient {
          @Override
          public boolean shouldOverrideUrlLoading(WebView view, String url) {          
                  return false;            
          }    
      }
  
      @Override
      public boolean onKeyDown(int keyCode, KeyEvent event) {
          if ((keyCode == KeyEvent.KEYCODE_BACK) &amp;&amp; webview.canGoBack()) {
              webview.goBack();
              return true;
          }
          return super.onKeyDown(keyCode, event);
      }    
  }
  </code></pre>