Reputation: 1707
I am writting a class in eclipse for android and i am having problems with my R.layout.main.
public class createplayer extends Activity{
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.createplayer);//problems with R
}
}
Upvotes: 1
Views: 611
Reputation: 2224
import android.R
, the problem is that Eclipse is looking for Android.R.layout.main instead of com.your.package.R.layout.main. So another alternative to is to replace import android.R
with import com.your.package.R
if removing it doesn't solve your problems.createplayer
Upvotes: 2
Reputation: 3179
What kind of problems are you having?
Cleaning your project may do the trick.
Otherwise, if R is not being created, there is probably an aapt error in parsing your xml files. You can manually run:
aapt package -m -v -J <path to your gen folder>/gen -M <path to your manifest>/AndroidManifest.xml -S <path to your res folder>/res -I <path to your android-sdk>/platforms/android-5/android.jar
This will list out where the problems are if your IDE is not telling you.
Upvotes: 0
Reputation: 3652
Check your imports for import android.R
and remove it. And otherwise try
project->clean.
Upvotes: 0