Code example for SoundPool

Methods: setOnLoadCompleteListener

0
 
		private Handler handler;
		private Context context;
		private SoundPool soundPool = new SoundPool(4,AudioManager.STREAM_MUSIC,0);
		private Field[] raws = R.raw.class.getFields();
		 
		public SoundRequestHandler(Context context, Handler handler) {
			this.handler = handler;
			this.context = context;
			 
			soundPool.setOnLoadCompleteListener(new OnLoadCompleteListener() {
				public void onLoadComplete(SoundPool soundPool, int sampleId, int status) {
					soundPool.play(sampleId, 0.99f, 0.99f, 1, 0, 1);
				} 
			}); 
		} 
		 
		public void handle(HttpRequest request, HttpResponse response, HttpContext arg2)
				throws HttpException, IOException { 
			 
Experience pair programming with AI  Get Codota for Java