Asthme
Asthme

Reputation: 5353

Non static method cannot be refrence as a static method

I just want to create drawable using color.

so i use this method Drawable background = Drawable.setColorFilter( 0xffff0000, PorterDuff.Mode.MULTIPLY ); here is my full code

@Override
protected void onCreate(Bundle savedInstanceState) {        
    super.onCreate(savedInstanceState);
    setContentView(R.layout.taketestactivity);
    Drawable background =   Drawable.setColorFilter( 0xffff0000, PorterDuff.Mode.MULTIPLY );
    }

Upvotes: 0

Views: 86

Answers (1)

Nabeel
Nabeel

Reputation: 31

setColorFilter is a method of the Drawable class. So after you declare background as a Drawable, then you can write:

background.setColorFilter( 0xffff0000, PorterDuff.Mode.MULTIPLY );

Upvotes: 1

Related Questions