-->

الدرس 118: تشغيل ملف صوتي من ذاكرة الهاتف



الكود
 


m = new MediaPlayer();

m.setAudioStreamType(3);
try {
m.setDataSource(url);

}catch (IllegalArgumentException e) {

Toast.makeText(getApplicationContext(), "You might not set the URI correctly!", 1).show();

} catch (SecurityException e2) {

Toast.makeText(getApplicationContext(), "You might not set the URI, correctly!", 1).show(); }

catch (IllegalStateException e3) {

Toast.makeText(getApplicationContext(), "You might not set the URI, correctly!", 1).show(); }

catch (java.io.IOException e4)
{
e4.printStackTrace();
}


try
{
m.prepare();
}
catch (IllegalStateException e5)
{
Toast.makeText(getApplicationContext(), "You might not set the URI correctly!", 1).show();
}
catch (java.io.IOException e6)
{
Toast.makeText(getApplicationContext(), "You might not set the URI correctly!", 1).show();
}
موح درويد
كاتب المقالة
كاتب ومحرر اخبار اعمل في موقع موح درويد .

جديد قسم : شروحات sketchware

إرسال تعليق