Wednesday, 11 September 2013

new to android - not able to access global variable in protected static method

new to android - not able to access global variable in protected static
method

here is my code:
protected static Bitmap scaleImage() {
Bitmap nad = BitmapFactory.decodeFile(path);
return nad;
}
"path" is a global variable, and it gives me an error stating: cannot make
a static reference to a non-static field path... may be this is happening
because path is a string, and not a static.. but how else can I access
other variables in here? I tried looking through the documentation but
could not find anything.

No comments:

Post a Comment