Array type expected; found int

16
April 15, 2019, at 9:10 PM

I'm receiving this error "Array type expected, found int" in my code and I don't know why and where is the trouble. Can somebody help me? This is my code:

private float curX = 0, curY = 0, curZ = 0;
static float acel;
static int cont=0;   
static int tamanio = 1200; 
static int int_buffer=tamanio;
public void onSensorChanged(SensorEvent event) {
    curX = event.values[0];
    curY = event.values[1];
    curZ = event.values[2];
    acel = curX * curX + curY * curY + curZ * curZ;
    int acel2 = Math.round(acel);
    //I RECIVE THE ERROR HERE:
    int_buffer[cont]=acel2;
    //AND HERE TOO
    if(int_buffer[cont]>max){
        max=int_buffer[cont];
    }
    if(int_buffer[cont]<min){
        min=int_buffer[cont];
    }
}
Answer 1

You declare int_buffer as an integer, try

int[] int_buffer = new int[tamanio];
READ ALSO
How a client process (in android IPC with aidl) be aware of remote sever class?

How a client process (in android IPC with aidl) be aware of remote sever class?

In Android official Aidl document, the IPC client example declares an intent explicitly with the target "RemoteServiceclass"

33
BLE Disconnection from device acting as advertisement having issue on central side no callback is received

BLE Disconnection from device acting as advertisement having issue on central side no callback is received

CASE 1: When I trying to disconnect from central to peripheral its workingCASE 2: When I am trying to disconnect the central from peripheral after calling cancel connection but its doesn't provide callback to central device

41
get message callback in emit event socket.io android

get message callback in emit event socket.io android

I use javascript code in web for send file name and file size to server with socketio and return bolean (true or false) from server

16
How can I use owfont in Android?

How can I use owfont in Android?

I'm using Owfont and I want to give the weather using the owfont fontI have an "ED31" code and I don't know how to send it

15