android


getStreamVolume always returns 0


AudioManager audioManager = (AudioManager) getSystemService(AUDIO_SERVICE);
int volume_level = audioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
Always returns 0 and of course real value it's not 0.
I read something about setRingerMode but I set all possible values but still returns 0.
Will someone help me? Thanks.
Try this code to get Volume value:
AudioManager audioManager = (AudioManager) getSystemService(AUDIO_SERVICE);
int volume_level = audioManager.getStreamVolume(AudioManager.STREAM_MUSIC);

Related Links

Do not show notification if it is already shown
Ignore spelling warning in Android studio for specific files
DownloadManager: understand retry policy and error codes
TabLayout user clickable tabs
Only getting partial screenprints
How to set SDK directory in gradle project
How to apply aspect ratio from material design specs on a view?
RecyclerView Item drawable states not working
I cannot find the error that is indicated: Array Adapter
RecyclerView row item touch listner
Organize buttons in android layout
Navigation Drawer Template in Android Studio
Open slack app from a hyperlink (or URL scheme)
android.permission.READ_PHONE_STATE is not recognized in androidmanifest.xml (Android Studio) [duplicate]
animate background color of multiple TextViews
How to get most recent result using Retrofit and Parse.com

Categories

HOME
go
scikit-learn
checkstyle
fuelux
time-complexity
eslint
android-studio-2.2
google-spreadsheet
character-encoding
interface
opendj
nested-if
limit
zip
modal-dialog
fosrestbundle
startup
php-5.6
cumulocity
mongodb-csharp
intershop
vuejs
forgot-password
foreign-keys
delphi-xe5
microsoft-ocr
poedit
spring-async
motion-detection
asymptotic-complexity
genexus-sd
subclass
winpe
corenlp-server
weather
cart
turfjs
simplecv
joomla2.5
installscript
openerp-7
css-position
spring-mvc-test
mcustomscrollbar
watchface
laravel-elixir
datacachefactory
glm-math
libgphoto2
automapper-5
yii2-api
user-defined-fields
google-cse
trojan
singleinstance
custom-font
skin
objectscript
cd-burning
ampps
filenet
juice-ui
reachability
stream-processing
data-protection
redis-cluster
phpgrid
dynatree
forwarding
ember-cli-rails
viola-jones
sha512
liquid-layout
jsvc
nsurlsessiondatatask
showdialog
contrast
psr-4
lambda-architecture
cuba
reflector
malformedurlexception
clickbank
spring-3
visual-studio-express
ie8-compatibility-mode
video-codecs
tree-balancing
onmousemove
web-farm
predicatebuilder
matlab-load
pylucene
cac
ie-compatibility-mode
delimited-text
scrollbars

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile