Advertisement
Guest User

Act2

a guest
Nov 7th, 2013
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.79 KB | None | 0 0
  1. public class DairyInqFragment extends Fragment {
  2.  
  3.     public static final String TAG = DairyInqFragment.class.getSimpleName();
  4.  
  5.     final static String LOG_TAG = "DairyInqFragmentLogs";
  6.  
  7.     ExpandableListView elview;
  8.     View v;
  9.     ArrayList<HashMap<String, Object>> menuItems1;
  10.     ArrayList<ArrayList<HashMap<String, String>>> parent_childs;
  11.     DairyInqExpandAdapter adapter;
  12.  
  13.     public void setargs(ArrayList<HashMap<String, Object>> menuItems1,
  14.             ArrayList<ArrayList<HashMap<String, String>>> parent_childs) {
  15.  
  16.         this.menuItems1 = menuItems1;
  17.         this.parent_childs = parent_childs;
  18.  
  19.     }
  20.  
  21.     public static DairyInqFragment newInstance(
  22.             ArrayList<HashMap<String, Object>> menuItems1,
  23.             ArrayList<ArrayList<HashMap<String, String>>> parent_childs) {
  24.  
  25.         DairyInqFragment f = new DairyInqFragment();
  26.         f.setargs(menuItems1, parent_childs);
  27.         return f;
  28.     }
  29.  
  30.     @Override
  31.     public View onCreateView(LayoutInflater inflater, ViewGroup container,
  32.             Bundle savedInstanceState) {
  33.  
  34.         v = inflater.inflate(R.layout.dairy_inq_fragment, container, false);
  35.  
  36.         elview = (ExpandableListView) v.findViewById(R.id.expand_lv);
  37.  
  38.         TextView txter = (TextView) v.findViewById(R.id.inq_title);
  39.  
  40.         String language = AppState.getLanguage();
  41.  
  42.         if (language.equals("ru")) {
  43.             txter.setText(R.string.p_qu_ru);
  44.         } else if (language.equals("en")) {
  45.             txter.setText(R.string.p_qu_en);
  46.         } else if (language.equals("de")) {
  47.             txter.setText(R.string.p_qu_de);
  48.         }
  49.  
  50.         adapter = new DairyInqExpandAdapter(getActivity(), menuItems1,
  51.                 parent_childs);
  52.  
  53.         elview.setAdapter(adapter);
  54.  
  55.         return v;
  56.     }
  57.  
  58.     public void setchanges() {
  59.  
  60.         adapter = new DairyInqExpandAdapter(getActivity(), menuItems1,
  61.                 parent_childs);
  62.  
  63.         elview = (ExpandableListView) v.findViewById(R.id.expand_lv);
  64.         elview.setAdapter(adapter);
  65.     }
  66.  
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement