Back to project page android-continuous-voice.
The source code is released under:
Copyright (c) 2015, Marius Fink - Universit?t Hamburg All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following ...
If you think the Android project android-continuous-voice listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package de.uniHamburg.informatik.continuousvoice; /* w w w .j a v a2s.c om*/ import android.app.Activity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import de.uniHamburg.informatik.continuousvoice.services.sound.AudioService; import de.uniHamburg.informatik.continuousvoice.views.fragments.RecognizerFragment; import de.uniHamburg.informatik.continuousvoice.views.fragments.VisualizerFragment; public class MainActivity extends Activity { //private String TAG = this.getClass().getSimpleName(); private RecognizerFragment voiceRecognitionFragment; private VisualizerFragment visualizationFragment; public void createServices() { AudioService audioService = new AudioService(); voiceRecognitionFragment = new RecognizerFragment(audioService); visualizationFragment = new VisualizerFragment(audioService); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); createServices(); setContentView(R.layout.activity_main); if (savedInstanceState == null) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if (savedInstanceState == null) { getFragmentManager().beginTransaction() .add(R.id.voiceRecognitionFragmentContainer, voiceRecognitionFragment) .add(R.id.visualizationFragmentContainer, visualizationFragment) .commit(); } } } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } @Override public void onPause() { super.onPause(); } @Override public void onStop() { super.onStop(); } }