How to make right or left or left to right transition between activities on sliding the screen

牧云@^-^@ 提交于 2019-12-24 18:53:19

问题


If I have three activities, I want to move from one activity to another when touching the moving on the screen horizontally(from left to right or right to left). how to access the action of sliding the screen and ?


回答1:


try this:

     try    {           
        Intent newIntent = new Intent(view.getContext(), NewActivity.class);    
        startActivityForResult(newIntent, 0);
        overridePendingTransition(android.R.anim.slide_in_left, android.R.anim.slide_out_right);        
    } catch(Exception ex) {
    }



回答2:


http://android-developers.blogspot.in/2011/08/horizontal-view-swiping-with-viewpager.html

and

http://blog.velir.com/index.php/2010/11/17/android-snapping-horizontal-scroll/



来源:https://stackoverflow.com/questions/11483567/how-to-make-right-or-left-or-left-to-right-transition-between-activities-on-slid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!