Code example for ViewSwitcher

Methods: getDisplayedChild

0
    //Override the default back key behavior 
    @Override 
    public void onBackPressed() { 
        //Emulate the progressDialog.setCancelable(false) behavior 
        //If the first view is being shown 
        if (viewSwitcher.getDisplayedChild() == 0) {
            //Do nothing 
            return; 
        } else { 
            //Finishes the current Activity 
            super.onBackPressed(); 
        } 
    } 
 
    @Override 
    public boolean onTouchEvent(MotionEvent evt) {
//        if(evt.getAction() == MotionEvent.ACTION_DOWN) { 
//            synchronized (splashThread) { 
//                splashThread.notifyAll(); 
//            } 
Connect your IDE to all the code out there  Get Codota for Java