android


When I click the listview button to play the sound on Android [closed]


I want to do the following;
When you click on the pictures, you want to play audio files. I looked at examples from the internet but could not find an answer. How can I do this?
here is the code
playButton = (ImageButton)findViewById(R.id.imageButton1);
MediaPlayer mysong = MediaPlayer.create(this, R.raw.song);
playbutton.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View arg0) {
mysong.start();
}
});
Use a MediaPlayer (refer this). Inside the onClick of ImageView, call the start() function for your requirement.

Related Links

Restrict cut/copy and paste between applications in android
-O2 flag in Android
How to pass catch block statement another Activity?
Listview gets recreated and changes the previous views
How to lay image over another image where the middle of the image should align with the bottom of the image underneath
Placing button or other widget at runtime on android app
Can Eclipse generate a default proguard configuration file
Refresh a particular tab using ActionBarSherlock
What is the rule of the name of the packages that start with number?
Lots of GC when scrolling ListView (with holder pattern)
Using Service stub during Activity Junit test
Downloading html source on Android Crashes the Application
animated sprite from texturepacker xml
get search result from website and parse it into android application using KSOAP2
SharedPreferences Base64 encoding assistance needed
Android on incoming call change the name on screen

Categories

HOME
notepad++
cygwin
assembly
scikit-learn
awk
ggplot2
github-for-windows
formal-languages
appcelerator
database-normalization
tail
babeljs
elasticsearch-5
extjs4.2
pega
mautic
line
x-cart
spring-social
stellar.js
capistrano3
git-extensions
charles
symbols
jquery-ias
question2answer
named-entity-recognition
ios10.2
perlbrew
moses
jackson-modules
gp
uitapgesturerecognizer
kudu
rselenium
xdocreport
unordered-map
levenshtein-distance
postgresql-8.4
lpsolve
angular-http
jboss-4.2.x
linter
gitlist
spring-integration-sftp
remedy
magic-draw
amq
seq
mach-o
flyout
trigger.io
offline.js
omxplayer
redbeard-ios
burrows-wheeler-transform
dotnetnuke-7
greatest-n-per-group
scaffolding
delta
jclouds
php-socket
dbamp
ellucian-scribe
beanstalk
findfirst
jparsec
toast
ascii-art
rasterize
relativelayout
dynamics-nav-2016
sciruby
extjs-grid
.bash-profile
wso2greg
teamcity-9.1
jbake
filesplitting
easyrtc
nsmenu
jama
vsx
multiautocompletetextview
multitasking
scrypt
abstract-data-type
font-awesome-4.0.0
mysql-error-2013
robotlegs
curb
tree-balancing
onmousemove
boost-msm
dajaxice
correlated-subquery
cuda-gdb
koken
node-redis
u2netdk
cdonts
aspmenu
asynchronous-wcf-call
fail-fast-fail-early

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App