Advertisement
Guest User

Untitled

a guest
Apr 15th, 2014
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.65 KB | None | 0 0
  1. View rootView.setFocusableInTouchMode(true);
  2. rootView.requestFocus();
  3. rootView.setOnKeyListener(new OnKeyListener()
  4. {
  5.  
  6. @Override
  7. public boolean onKey(View v, int keyCode, KeyEvent event)
  8. {
  9. int i = ((PersianBeautyApplication) getActivity().getApplication()).fragmentStack.size();
  10. FragmentStack fragmentStack = ((PersianBeautyApplication) getActivity()
  11. .getApplication()).fragmentStack.get(i - 1);
  12. if (keyCode == KeyEvent.KEYCODE_BACK )
  13. {
  14.  
  15. System.out.println("Profile info.....");
  16. fragmentStack = ((PersianBeautyApplication) getActivity().getApplication()).fragmentStack.pop();
  17. //FragmentStack fragmentStack1 = ((PersianBeautyApplication) getActivity().getApplication()).fragmentStack.pop();
  18. System.out.println(fragmentStack.getFragmenttab()+",,,,,,,,,,,,,,,,,,,,,tab...checked");
  19. //int id=fragmentStack.getFragmentid();
  20. // if(((PersianBeautyApplication) getActivity()
  21. // .getApplication()).fragmentStack.pop().getFragmenttab().equalsIgnoreCase("M"))
  22. // {
  23.  
  24. i = ((PersianBeautyApplication) getActivity()
  25. .getApplication()).fragmentStack.size();
  26. i = i - 1;
  27. System.out.println("Profile");
  28.  
  29. System.out.println(i + "....Position");
  30. fragmentStack = ((PersianBeautyApplication) getActivity()
  31. .getApplication()).fragmentStack.elementAt(i);
  32. System.out.println(fragmentStack.getFragmentid()
  33. + "............");
  34. System.out.println(fragmentStack.getFragment()+ "............");
  35. fragmentStack.set_Is_new(false);
  36. int id = fragmentStack.getFragmentid();
  37. Fragment fragment = fragmentStack.getFragment();
  38. fragmentSet(id, fragment);
  39.  
  40.  
  41.  
  42. // }
  43.  
  44.  
  45. return true;
  46. } else {
  47. ((PersianBeautyApplication) getActivity()
  48. .getApplication()).fragmentStack.get(i - 1)
  49. .set_Is_new(true);
  50. return false;
  51. }
  52.  
  53.  
  54. }
  55.  
  56.  
  57.  
  58. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement