How can i get accelerometer values from onSensorChanged to class ThreatForLoopA?
<p>For example. I´m working with accelerometer and i want values x,y,z in another class ThreatForLoopA.</p>

<pre><code>@Override
public void onSensorChanged(int sensor, float[] values) {
    // TODO Auto-generated method stub

    x = values[0];
    y = values[1];
    z = values[2];

    ThreadForLoopA threadA = new ThreadForLoopA();

    if (sensor == SensorManager.SENSOR_ACCELEROMETER) {
        long curTime = System.currentTimeMillis();

    threadA.start();
</code></pre>

<p>This is example of class ThreatForLoopA:</p>

<pre><code>public class ThreadForLoopA extends Thread{

TextView xacc = null;
TextView yacc = null;
TextView zacc = null;

float[][] p= new float[5][3];
private long lastUpdate = -1;
public float x,y,z;
int row = 0;

@Override
public void run() {
    // TODO Auto-generated method stub

    long curTime = System.currentTimeMillis();

    if (lastUpdate == -1 || (curTime - lastUpdate) &gt; 2000) {
        lastUpdate = curTime;

            for (int column = 0; column &lt; 3; column++) {
                if (column == 0) {
                    p[row][column] = x;
                    //xacc.setText("Os X: " + p[row][column]);
                }
                if (column == 1) {
                    p[row][column] = y;
                    //yacc.setText("Os X: " + p[row][column]);
                }
                if (column == 2) {
                    p[row][column] = z;
                    //zacc.setText("Os X: " + p[row][column]);
                }}
                if (row == 0) {
                    xacc.setText("Os X: " + p[row][0] + " " + p[row][1] +" " + p[row][2]);
                }
</code></pre>

<p>How can i get accelerometer values from onSensorChanged to class ThreatForLoopA?</p>
