Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

play sound on button click android studio

Button one = (Button) this.findViewById(R.id.button1);
final MediaPlayer mp = MediaPlayer.create(this, R.raw.soho);
one.setOnClickListener(new OnClickListener(){

    public void onClick(View v) {
        mp.start();
    }
});
Comment

PREVIOUS NEXT
Code Example
Java :: onclick android 
Java :: java read each lines in file 
Java :: creating modulu function withou using % java 
Java :: Java code to print odd number 
Java :: get first 5 characters of string java 
Java :: javafx every second 
Java :: file to image javafx 
Java :: add certificate to java truststore 
Java :: string to enum java 
Java :: Java forName() method 
Java :: java discord bot get id of message it just sent 
Java :: java yes or no loop 
Java :: Copying Arrays Using copyOfRange() method Java 
Java :: hibernate select count 
Java :: isblank vs isempty 
Java :: convert double to in in java 
Java :: swap function java 
Java :: java how to print 
Java :: javadoc link to class 
Java :: java system.out.print two dimensional array 
Java :: java get input 
Java :: java while schleife 
Java :: select word from array 
Java :: how to open an activity from a fragment 
Java :: has integer java 
Java :: how to convert arraylist to array in java 
Java :: java random guid 
Java :: 64 encode java 
Java :: change button text java 
Java :: write a name and convert it to an array 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =