You either have to pass the timeslice argument (mediaRecorder.start(1000);) to make it fire the event periodically;
or to explicitly call mediaRecorder.requestData(). to trigger the event.
Calling mediaRecorder.stop() will also fire the dataavailable event.