Nabmeister
Nabmeister

Reputation: 795

main cannot be resolved or is not a field, R.layout.main

    package org.example.sudoku;
    import android.app.Activity;
    import android.os.Bundle;
    import org.example.sudoku.R; 

    public class Sudoku extends Activity {
    /** Called when the activity is first created. */
          @Override
          public void onCreate(Bundle savedInstanceState) {
                 super.onCreate(savedInstanceState);
                 setContentView(R.layout.main);
          }
     }

I imported R but still it shows that main cannot be resolved or is not a field

Upvotes: 1

Views: 2830

Answers (1)

RE6
RE6

Reputation: 2724

First, delete:

import org.example.sudoku.R; 

Then, in eclipse go to project>clean , choose your project and press OK. Then wait until it is done. The clean operation regenrates R.

Upvotes: 3

Related Questions