activity cannot be resolved

by rakesh » Tue, 02 Feb 2010 16:55:31 GMT

Sponsored Links
 int mainBackGroundColor
        = activity .getResources.getColor
when iam trying to access a color resource iam getting activity cannot
be resolved error in eclipse. how can this be resolved.

thanks in advance


activity cannot be resolved

by jotobjects » Wed, 03 Feb 2010 01:25:45 GMT

 Do you have a res/values/color.xml file with main_back_ground_color

Are you "cleaning" and rebuilding your project?  It is necessary that
bin and gen directories are recreated any time there is a change to
resources such as colors.xml


Sponsored Links

Other Threads

1. ListView setAdapter in onCreate, getChildCount is zero in onStart?

Your activity (and your list-view) is not yet visible in the onStart.

Don't use 'getChildCount' and 'getChildAt' method to check your

BTW: If your activity is not yet visible, how can a user make a
Shouldn't you query in the onPause, for example.
And also, the positions returned by the method getCheckedItemPositions
() are the positions in your adapter (ArrayAdapter in your case). Your
list-*view* positions (used in getChildAt) are not the same. You list-
view will never have more children than the ones you can see. And the
child-at postion 0 is the one on the top of the list-view.


2. I have a great idea for an app and have tried my best but cant get anything to work!! Help please!!

It is a map i done using my maps/google maps that has links to haunted
places around essex, including statements and pics. I only need to create
app to link to my map etc

What does your app actually do?


----- Original Message ----- From: "pulsarman325" <> To: "Android Begin...


3. Extending an Already Existing View in android.widget gives me java.lang.VerifyError

4. setTheme() not working

5. Google: please change your release process

6. How to read USB state?