According to the second answer here, I can click on some icon within the build window in order to view the errors. The problem is that I cannot find the build window. There is a build variants window but no combination of changes that I can make in it will change anything
Error:(23, 10) error: ')' expected
Error:(27, 28) error: ';' expected
Error:(27, 54) error: ';' expected
Error:(31, 2) error: reached end of file while parsing
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
This is my program
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Button;
import android.view.View;
public class MainActivity extends AppCompatActivity {
public void myButtonListenerMethod() {
Button button = (Button)findViewById(R.id.button);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
RelativeLayout bgElement = (RelativeLayout)findViewById(R.id.activity_main);
int color = ((ColorDrawable)bgElement.getBackground()).getColor();
if (color == Color.RED) {
bgElement.setBackgroundColor(Color.BLUE);
} else {
bgElement.setBackgroundColor(Color.RED);
}
}
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
This is currently what the bottom toolbar in my android studio looks like