Example #1
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // #if ${piramide.user.capabilities.problems}
    // #if ${piramide.user.capabilities.problems.sight}
    // #if ${piramide.user.capabilities.problems.sight.diopters} < 15
    setContentView(R.layout.location_normal);
    // #else
    setContentView(R.layout.location_sight_disability);
    tts = new TextToSpeechWeb();
    tts.init(getApplicationContext(), Constants.DEFAULT_LANGUAGE);
    vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
    // #endif
    // #endif
    // #endif
    Log.d(Constants.TAG, "Launching CurrentLocation...");
    createCurrentLocationList();

    location = (TextView) findViewById(R.id.location);
    location.setText(LocationService.getLocation());

    // #if ${piramide.user.capabilities.problems.sight.diopters} > 15
    tts.speech((String) location.getText());
    // #endif

    setResult(Constants.SUCCESS_RETURN_CODE, new Intent());
  }
Example #2
0
 @Override
 protected void onDestroy() {
   if (tts != null) {
     tts.stop();
   }
   super.onDestroy();
 }
Example #3
0
 @Override
 public void onBackPressed() {
   if (tts != null) {
     tts.stop();
   }
   this.finish();
   super.onBackPressed();
 }