Activity setVolumeControlStream - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Activity setVolumeControlStream method.

This code example shows how to use the following methods:getSystemService, setVolumeControlStream, getClass
	public void disableKeyguard(Activity activity) {
		if (mKeyguardLock != null) {
		} else { 
			KeyguardManager keyguardManager = (KeyguardManager) activity.getSystemService(Activity.KEYGUARD_SERVICE);
			mKeyguardLock = keyguardManager.newKeyguardLock(KEYGUARD_TAG);
	public void enableKeyguard() { 
		if (mKeyguardLock != null) {
		mKeyguardLock = null;
	public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {

This code example shows how to use the following methods:setVolumeControlStream
        public void setVolumeControlStream(int streamType) {
            Activity activity = mActivityReference.get();
            if (activity != null) {
     * Controls a TextView with dynamically changing text. 
     * <p> 
     * There are two methods here of interest, 
     * {@link TextViewWithMessagesController#setPermanentText(String)} and 
     * {@link TextViewWithMessagesController#setTemporaryText(String, long, TimeUnit)}.  The 
     * former is used to set the text on the text view immediately, and is used in our case for 
     * the countdown of duration remaining during voicemail playback.  The second is used to 
     * temporarily replace this countdown with a message, in our case faster voicemail speed or 
     * slower voicemail speed, before returning to the countdown display. 

Related Activity setVolumeControlStream Questions & Answers:

setVolumeControlStream Method Overview
Suggests an audio stream whose volume should be changed by the hardware volume controls.
See Code Examples for other Android Activity Methods: