使用自定义的 Activity 栈来管理 Android 的A ctivity
2010-03-03 15:53:00 来源:WEB开发网核心提示:33. }34. public void pushActivity(Activity activity){35. if(activityStack==null){36. activityStack=new Stack();37. }38. activityStack.add(activity);39. }40.41.
33. }
34. public void pushActivity(Activity activity){
35. if(activityStack==null){
36. activityStack=new Stack();
37. }
38. activityStack.add(activity);
39. }
40.
41. public void popAllActivityExceptOne(Class cls){
42. while(true){
43. Activity activity=currentActivity();
44. if(activity==null){
45. break;
46. }
47. if(activity.getClass().equals(cls) ){
48. break;
49. }
50. popActivity(activity);
51. }
52. }
53. }
更多精彩
赞助商链接