Java/Android : passing accelerometer value from onSensorChanged method to onCreateSetContentView()
<p>I'm new on Java and Android programming language and this is the first platform that I studied.
I want to ask, how can I access the event.values[1] in this method?</p>

<pre><code>public void onSensorChanged(SensorEvent event) {synchronized (this){
    if (event.sensor.getType() != Sensor.TYPE_ACCELEROMETER)

        return;
    mAccVals.x = (float) (event.values[1] * FILTERING_FACTOR + mAccVals.x * (1.0 - FILTERING_FACTOR));
    //mAccVals.y = (float) ((-event.values[1] * FILTERING_FACTOR + mAccVals.y * (1.0 - FILTERING_FACTOR)));
    mAccVals.z = (float) (event.values[2] * FILTERING_FACTOR + mAccVals.z * (1.0 - FILTERING_FACTOR));

    scene.camera().position.x = mAccVals.x * .2f;
    scene.camera().position.z = mAccVals.z * .8f;

    scene.camera().target.x = -scene.camera().position.x;
    scene.camera().target.z = -scene.camera().position.z;

}
</code></pre>

<p>I want to get event.values[1] and then display it on a textview</p>

<pre><code>protected void onCreateSetContentView()
{   
    setContentView(R.layout.custom_layout_example); 
        LinearLayout ll = (LinearLayout) this.findViewById(R.id.scene1Holder);
        ll.addView(_glSurfaceView);
        TextView myTextView = (TextView) findViewById(R.id.splashTitle); 
        myTextView.setText("Test " + event.values[1]  );
        return;                  
 }
</code></pre>

<p>There's any suggestion how can I solve this problem?
Thanks in advance</p>
