Amrmsmb
Amrmsmb

Reputation: 1

Options method of the BitmapFactory is not recognized

When I tried to use the options of the BitmapFactory as follows:

BitmapFactory.Options options = new BitmapFactory().Options(); eclipse underscores the options() on the right hand side with red squiggle, despite all the required packages are imported. How to solve it?

Upvotes: 0

Views: 59

Answers (2)

Blundell
Blundell

Reputation: 76468

You where so close:

BitmapFactory.Options options = new BitmapFactory.Options();

You want to instantiate the Options not the Factory


If if helps you make sense of it, you could also import the options

import static android.graphics.BitmapFactory.Options;

    Options options = new Options();

Upvotes: 2

Ibrahim Disouki
Ibrahim Disouki

Reputation: 2693

BitmapFactory.Options options = new BitmapFactory.Options();

Not

BitmapFactory.Options options = new BitmapFactory().Options();

Upvotes: 2

Related Questions