Skip to content
Advertisement

Image not being initialized

I am makin a tic tac toe game. My circle image does not initialize and shows out of memory error.

It shows this in Run: Click here for image

I tried using other image but it does not work.

My java code

JavaScript

and so on for 9 buttons

Thanks in advance and hope this question is clear!.

Advertisement

Answer

Solution:

change the configuration on the virtual devices in the emulator under “Emulated Performance – Graphics” so they use Software GLES 1.1

Source


Note: Try to make your code easier to read. Idea:

  1. Don’t use variables box1, box2 …, make an int[] box = new int[9];

  2. Use a class that extends OnClickListener

Code:

JavaScript

How to apply it:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement