Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stop = (Button) findViewById(R.id.stop);
- stop.setVisibility(View.INVISIBLE);
- stop.setOnClickListener(new View.OnClickListener()
- {
- public void onClick(View v)
- {
- mp.stop();
- Log.d("mp", "stopped");
- mp.reset();
- Log.d("mpreset", "ok");
- String filePath = "C:\\Users\\Adir\\AndroidStudioProjects\\ShaharsBday\\app\\src\\main\\res\\raw\\sia.mp3";
- try {
- mp.setDataSource(filePath);
- Log.d("mpset", "ok");
- } catch (IOException e) {
- e.printStackTrace();
- }
- try {
- mp.prepare();
- Log.d("mp", "prepared");
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement