 <p>You are accessing <code>getResources()</code> without a reference to a <code>Context</code>. Because this is a static method, you can only access other static methods within that class without providing a reference.</p> <p>Instead, you must pass the <code>Context</code> as an argument:</p> <pre><code>// the 34th button Button tf = (Button) findViewById(R.id.tFour); tf.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Apply.applyBitmap(v.getContext(), R.drawable.tFour); // Pass your context to the static method } }); </code></pre> <p>Then, you must reference it for <code>getResources()</code>:</p> <pre><code>public static void applyBitmap(Context context, int resourceID) { BitmapFactory.Options opt = new BitmapFactory.Options(); opt.inScaled = true; opt.inPurgeable = true; opt.inInputShareable = true; Bitmap brightBitmap = BitmapFactory.decodeResource(context.getResources(), resourceID, opt); // Use the passed context to access resources brightBitmap = Bitmap.createScaledBitmap(brightBitmap, 100, 100, false); MyBitmap = brightBitmap; } </code></pre>