Code example for FileInputStream

Methods: getFD

0
	        fos.write(audio);
	        fos.close();
  
	        mediaPlayer = new MediaPlayer();
 
	        FileInputStream fis = new FileInputStream(temp);
	        mediaPlayer.setDataSource(fis.getFD());
	         
	        //mediaPlayer.setDataSource(r.openRawResourceFd(R.raw.lian).getFileDescriptor()); 
	        mediaPlayer.prepare();
 
	    } catch (IOException ex) {
	        ex.printStackTrace();
	    } 
		 
		return mediaPlayer;
	} 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE