0

Long story made short:

I had a few problems working on my MP3 Player for a Finals Project. Eclipse didn't generate a R.java file on my project, so i created a new one. I declare all the layout, id, drawable and the buttons i have. This "id cannot be resolved or is not a field" wasn't a problem a few moments before, Quick Fix Fixed (Duh!) it for me creating a field in my R.Java file in the gen folder.

But the thing i have this code:

    @Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.id.playlist);

~~~~~~~~~~~~~~~Harmless code~~~~~~~~~~

  // Add menuItems to ListView
    ListAdapter adapter = new SimpleAdapter(this, songsListData,
            R.layout.playlist_item, new String[] { "songTitle" }, new int[] {
                    R.id.songTitle });

Both R.layout.playlist and R.id.songTitle are supposed to be declared on my R.Java.

Any Help Here?

Jonathon Reinhart
  • 132,704
  • 33
  • 254
  • 328

1 Answers1

0

You're referencing R.layout.playlist_item in your list adapter. Are you sure R.layout.playlist_item exists? Have you tried doing Project > Clean in Eclipse?

hungryghost
  • 9,463
  • 3
  • 23
  • 36
  • Every time i Clean the Project, R.Java is deleted and i have to restore it – Slipfreak900 Jun 12 '14 at 21:32
  • Have you read through this [post](http://stackoverflow.com/questions/885009/r-cannot-be-resolved-android-error)? I've run into issues related to R.java because I often do a ctrl-shift-O to add imports. There was one time Eclipse mistakenly added a `import android.R`, which will throw everything off. – hungryghost Jun 12 '14 at 22:17
  • i've aslo read about that issue, and i had no "import android.R" on my entire Projct – Slipfreak900 Jun 12 '14 at 22:52