Code example for ViewSwitcher

Methods: getDisplayedChildshowPrevious

0
 
	@Override 
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		if (keyCode == KeyEvent.KEYCODE_BACK) {
			if (mReadFile) {
				if (mSwitcher.getDisplayedChild() != 1) {
					mSwitcher.showPrevious();
					return true; 
				} else { 
					mBackKeyPressed = true;
					return true; 
				} 
			} else if (mSwitcher.getDisplayedChild() != 0) {
			} else { 
				return super.onKeyDown(keyCode, event);
			} 
		} 
		return super.onKeyDown(keyCode, event);
	} 
 
Connect your IDE to all the code out there  Get Codota for Java