why the UI does not show till the while loop breaks?
this code is answered in Voice Detection in Android Application . It works fine but there is issue that the content of the page does not load until and unless the any voice has been detected and this snippet also makes the app crash few a times public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); // Get the minimum buffer size required for the successful creation of an AudioRecord object. int bufferSizeInBytes = AudioRecord.getMinBufferSize( RECORDER_SAMPLERATE, RECORDER_CHANNELS, RECORDER_AUDIO_ENCODING ); // Initialize Audio