I'm using version 0.3.7 of Android Studio, and I'm trying out OpenGL ES programming. This requires a lot of imports from such classes as "android.opengl.GLES20"
Instead of auto importing GLES20 and accessing for example, the GL_COMPILE_STATUS variable like so:
glGetShaderiv(shaderObjectID, GLES20.GL_COMPILE_STATUS, compileStatus, 0);
I'd rather type in GL_COMPILE_STATUS and have it auto import the following:
import static android.opengl.GLES20.GL_COMPILE_STATUS;
...
glGetShaderiv(shaderObjectID, GL_COMPILE_STATUS, compileStatus, 0);
And have the above import found as I type in GL_COMPILE_STATUS.
But the current system will not know that GL_COMPILE_STATUS comes from the GLES20 class. So my question is this, is there a way to assist the organize imports functionality in Android Studio for finding these variable? I'd like to keep my code to a minimum, and having to write GLES20. in front of everything is a little off putting - and I won't use a wildcard import as I consider that bad practice.
The answers of this post will help you.
Settings -> Code Style -> Java -> Imports
ctrl+space two times
and then alt + enter
to import it statically without full qualifier. If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With