java - R can not be resolved while using MediaPlayer -



java - R can not be resolved while using MediaPlayer -

import android.media.mediaplayer; mediaplayer mp = mediaplayer.create(moschipactivitysec.this, r.raw.button);

here button .mp3 sound file resides in raw folder in res,getting r not resolved!

two things might causing this.

firstly have @ imports section of class. eclipse imports different r file, causes error. if there's in imports imports random r file delete line.

otherwise r file hasn't been created properly, clean , rebuild fixes, other times i've had delete r file , rebuild.

if neither of these prepare allow know.

java android eclipse android-intent eclipse-plugin

Comments

Popular posts from this blog

delphi - blogger via idHTTP : error 400 bad request -

c++ - cuda, pycuda -- how to write complex numbers -- errors:class "cuComplex" has no member "i" -

How do I check if an insert was successful with MySQLdb in Python? -