Reputation: 1021
I really tried to use coverflow and it makes me really frustrated. I don't know where to start but am trying to figure with my a little knowledge. But I was encountering a big barrier here. Although my images1~6 are png, it says image cannot be resolved. When I delete import android.R and retype like import at.hellohello.samples.R, it has a red underline. When there is nothing in the import section and I clicked command+shift+o, automatically android.R appeared. I'm stucked in this stage for 1 week...
package at.hellohello.samples;
import android.R;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
public class FancyCoverFlowSampleAdapter extends FancyCoverFlowAdapter {
// =============================================================================
// Private members
// =============================================================================
private int[] images = {R.drawable.image1, R.drawable.image2, R.drawable.image3, R.drawable.image4, R.drawable.image5, R.drawable.image6,};
..
Please help me
And in other code, R.styleable cannot be resolved. I really want to know what it is and solve it :( I'm looking forward to hearing any opinions!
Upvotes: 0
Views: 538
Reputation: 1369
I'm going to go out on a limb here and assume that all of your resources R.drawable, R.layout, R.anything are unresolved. This is likely due to the R.java file not generating correctly. Look in gen/yourapppackage to find R.java. If it's not there, you've got a problem. If it is there, open it up and take a look to see if your resources are listed in there. If they are there and not being recognized, try doing a clean build (in Eclipse Project > Clean...). If R.java does not regenerate then you most likely have an issue in your XML somewhere (probably in a layout file). Fix your XML problem and then clean again and you should be fine.
Note that you should not need to import android.R.
Upvotes: 1
Reputation: 64409
I guess that this line is not what you want:
import android.R;
If you have the issue of unresolved R
when you remove that, think about this:
R is a generated class, it should be available. If it isn't, do not auto-import any R you can find, but look at the problems in your code: something is stopping R from being generated. This can be a syntax error, or some other unresolved problem. It can be anything, so it's a bit too broad to try and cover all that here. Check out your 'problems' tab in your IDE (Eclipse?) if you use that.
Upvotes: 1