Results 1 to 5 of 5
  1. #1
    newProgrammer is offline Member
    Join Date
    Mar 2012
    Posts
    8
    Rep Power
    0

    Default eclipse java cannot be resolved or is not a field

    Im using the Android Boot Camp book, during chapter program ive run in to this issue
    Java Code:
    package net.androidbootcamp.healthyrecipes;
    
    import android.app.Activity;
    import android.os.Bundle;
    
    public class Recipe extends Activity {
    	@Override
    	protected void onCreate(Bundle savedInstanceState) {
    		// TODO Auto-generated method stub
    		super.onCreate(savedInstanceState);
    	setContentView(R.layout.recipe);
    	}
    }
    the issue is on line 11 for recipe, it says nothing of this error in the book,

    i also get a simliar error regarding a button
    Java Code:
    package net.androidbootcamp.healthyrecipes;
    
    import android.os.Bundle;
    import android.app.Activity;
    import android.content.Intent;
    import android.view.Menu;
    import android.view.View;
    import android.view.View.OnClickListener;
    import android.widget.Button;
    
    public class Main extends Activity {
    
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
            Button b = (Button) findViewById(R.id.btnRecipe);
            b.setOnClickListener(new OnClickListener() {
    			
    			public void onClick(View v) {
    				// TODO Auto-generated method stub
    				startActivity(new Intent(Main.this, Recipe.class));
    			}
    		}); 
        }
    }
    this 1 is on line 17 for btnRecipe, ive looked up this problem but cant seam to find the issue i would greatly appreciate any help.

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,097
    Rep Power
    20

    Default Re: eclipse java cannot be resolved or is not a field

    Can you post the full error message.

    Oh hang on, that's from the resources stuff.
    I'll shift this to the Android forum since it's an Android question.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,097
    Rep Power
    20

    Default Re: eclipse java cannot be resolved or is not a field

    Blast...let's try and hit the right Android forum this time.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,097
    Rep Power
    20

    Default Re: eclipse java cannot be resolved or is not a field

    That's better.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  5. #5
    newProgrammer is offline Member
    Join Date
    Mar 2012
    Posts
    8
    Rep Power
    0

    Default Re: eclipse java cannot be resolved or is not a field

    the full error message is recipe/btnrecipe cannot be resolved or is not a field. but now for some reason i can not reopen the programm so i will have to rebuild and hopefully this time no problems show up

Similar Threads

  1. cannot be resolved or is not a field
    By Stevemagegod in forum Eclipse
    Replies: 3
    Last Post: 04-10-2012, 12:14 AM
  2. Replies: 1
    Last Post: 10-25-2010, 12:20 PM
  3. The import java.security cannot be resolved??
    By Harrie_KalaChakra in forum Eclipse
    Replies: 9
    Last Post: 01-20-2010, 05:15 AM
  4. Eclipse "import not resolved" package problem?
    By spamsickle in forum New To Java
    Replies: 3
    Last Post: 08-24-2009, 11:44 AM
  5. Javax.net is not resolved in Eclipse
    By ansh12 in forum Eclipse
    Replies: 0
    Last Post: 07-04-2009, 12:27 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •