I know it's too late now , but i am posting the answer for anyone will come later.
it was just about releasing created objects of ToneGenerator
because rapidly creating objects of 'ToneGenerator' without releasing them will cause the application to crash.
complete code :
final ToneGenerator tg = new ToneGenerator(AudioManager.STREAM_NOTIFICATION, 100);
tg.startTone(ToneGenerator.TONE_PROP_BEEP);
tg.release();