title: Can't get app to update based on accelerometer data in Android Studio
body: <p>I am trying to clear the text labels/output when the phone is shaken by using accelerometer data. </p>
  
  <p>This is what I have:</p>
  
  <pre><code>imports ....
  public class Main_Activity extends AppCompatActivity implements TextToSpeech.OnInitListener, SensorEventListener{
  
      public void onAccuracyChanged(Sensor arg0, int arg1){
  
      }
  
      public void onSensorChanged(SensorEvent event){
  
          double ax = event.values[0];
          double ay = event.values[1];
          double az = event.values[2];
          double a = Math.sqrt(ax*ax + ay*ay + az*az);
  
          if(a &gt; 20){
              ((EditText) findViewById(R.id.pBox)).setText("");
              ((EditText) findViewById(R.id.aBox)).setText("");
              ((EditText) findViewById(R.id.iBox)).setText("");
              ((TextView) findViewById(R.id.output)).setText("");
          }
  
  
      public void buttonClicked(View v){
          // getting values entered by user and showing output
      }
  }
  
  </code></pre>
  
  <p>Everything works except when I shake my phone, the text doesn't clear.</p>