Random rand2=new Random(); ran4=rand2.nextInt(10)+1;//imageVie4 หรือ โจท์ย if(ran4==1) { imageView3.setImageResource(R.drawable.j1); playsong1 = MediaPlayer.create(this, R.raw.songj1); playsong1.start(); TimerTask tt = new TimerTask() { public void run() { runOnUiThread(new Runnable() { public void run() { playsong1.start(); } }); } }; Timer tm = new Timer(); tm.schedule(tt, 10000); new CountDownTimer(15000, // msec to finish 10000) { // msec to tick public void onTick(long millisUntilFinished) { playsong1.start(); } public void onFinish() { playsong1.stop(); } }; } if (ran4 == 2){ imageView3.setImageResource(R.drawable.j2); playsong2 = MediaPlayer.create(this, R.raw.songj2); playsong2.start(); TimerTask tt = new TimerTask() { public void run() { runOnUiThread(new Runnable() { public void run() { playsong2.start(); } }); } }; Timer tm = new Timer(); tm.schedule(tt, 10000); new CountDownTimer(15000, // msec to finish 10000) { // msec to tick public void onTick(long millisUntilFinished) { playsong2.start(); } public void onFinish() { playsong2.stop(); } }; } if (ran4 == 3){ imageView3.setImageResource(R.drawable.j3); playsong3 = MediaPlayer.create(this, R.raw.songj3); playsong3.start(); TimerTask tt = new TimerTask() { public void run() { runOnUiThread(new Runnable() { public void run() { playsong3.start(); } }); } }; Timer tm = new Timer(); tm.schedule(tt, 10000); new CountDownTimer(15000, // msec to finish 10000) { // msec to tick public void onTick(long millisUntilFinished) { playsong3.start(); } public void onFinish() { playsong3.stop(); } }; }
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง