public TiListView(TiViewProxy proxy, Activity activity) { super(proxy); // initializing variables sections = new ArrayList<ListSectionProxy>(); itemTypeCount = new AtomicInteger(2); templatesByBinding = new HashMap<String, TiListViewTemplate>(); defaultTemplateBinding = UIModule.LIST_ITEM_TEMPLATE_DEFAULT; caseInsensitive = true; // handling marker HashMap<String, Integer> preloadMarker = ((ListViewProxy) proxy).getPreloadMarker(); if (preloadMarker != null) { setMarker(preloadMarker); } else { resetMarker(); } // initializing listView and adapter ListViewWrapper wrapper = new ListViewWrapper(activity); wrapper.setFocusable(false); wrapper.setFocusableInTouchMode(false); listView = new ListView(activity); listView.setLayoutParams( new ViewGroup.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); wrapper.addView(listView); adapter = new TiBaseAdapter(activity); // init inflater if (inflater == null) { inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } listView.setCacheColorHint(Color.TRANSPARENT); getLayoutParams().autoFillsHeight = true; getLayoutParams().autoFillsWidth = true; listView.setFocusable(true); listView.setFocusableInTouchMode(true); listView.setDescendantFocusability(ViewGroup.FOCUS_AFTER_DESCENDANTS); try { headerFooterId = TiRHelper.getResource("layout.titanium_ui_list_header_or_footer"); listItemId = TiRHelper.getResource("layout.titanium_ui_list_item"); titleId = TiRHelper.getResource("id.titanium_ui_list_header_or_footer_title"); listContentId = TiRHelper.getResource("id.titanium_ui_list_item_content"); isCheck = TiRHelper.getResource("drawable.btn_check_buttonless_on_64"); hasChild = TiRHelper.getResource("drawable.btn_more_64"); disclosure = TiRHelper.getResource("drawable.disclosure_64"); accessory = TiRHelper.getResource("id.titanium_ui_list_item_accessoryType"); } catch (ResourceNotFoundException e) { Log.e(TAG, "XML resources could not be found!!!", Log.DEBUG_MODE); } this.wrapper = wrapper; setNativeView(wrapper); }