How do you use context in classes?
<pre><code>package com.lala.image;

import com.lala.ContextStore;

import android.R;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.view.View;

public class Stationary implements Image{

    View v;
    Context context;
    String image;
    Bitmap img;

    float x;
    float y;


    public Stationary(Context context, String image) {
        // TODO Auto-generated constructor stub
        this.image = image;
        this.context = context;
        this.setImage(image);
    }

    public void setImage(String image) {
        // TODO Auto-generated method stub

        if(image=="bdfs"){
            this.img = BitmapFactory.decodeResource(context.getResources(), R.id.icon);
        }
        else if(image=="ssdfsdf"){
            this.img = BitmapFactory.decodeResource(context.getResources(), R.id.icon); 
        }
        else if(image=="asfdsdf"){
            this.img = BitmapFactory.decodeResource(context.getResources(), R.id.icon); 
        }
        else{
            this.img = BitmapFactory.decodeResource(context.getResources(), R.id.icon); 
        }
    }

    public Bitmap getImage(){
        return img;
    }

    public float getX() {
        // TODO Auto-generated method stub
        return this.x;
    }

    public float getY() {
        // TODO Auto-generated method stub
        return this.y;
    }

    public void setX(float x) {
        // TODO Auto-generated method stub
        this.x = x;
    }

    public void setY(float y) {
        // TODO Auto-generated method stub
        this.y = y;
    }

}
</code></pre>

<p>I am not sure how to use context and resources in a class when it is called from another activity.</p>

<p>I am getting an error message when the context or resources are called.</p>

<p>Any code to assist would be very welcome.</p>

<p>Thanks for your time</p>
