Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-24414

Android - Fails to cast Ti ListView to native ListView

    Details

      Description

      I'm trying to access native ListView methods. I need to cast a Ti ListView to a native Android ListView to access the native methods.

      I'm using the following link as a reference: http://docs.appcelerator.com/platform/latest/#!/guide/Android_Hyperloop_Programming_Guide

      You can use the snippet of code:

      var tiListView = Ti.UI.createListView({});
      var ListViewClass = require('android.widget.ListView');
      var nativeListView = new ListViewClass(tiListView);
      

      Running the above code will give you the following error:

      [ERROR] :  HyperloopProxy: (main) [5496,10667] Unable to find matching constructor for class: android.widget.ListView, args: [ti.modules.titanium.ui.widget.listview.TiListView$ListViewWrapper{d8c5545 V.E...CL. ......I. 0,0-0,0 #1e}]
      

      You can also can get the Hyperloop-Examples project from appcelerator's github page and replace the button.js controller in the project with the button.js file I attached.
      https://github.com/appcelerator/hyperloop-examples

      The reason why I want to access native methods on the ListView is to get the count of visible ListViewRows in the ListView when searching through the ListView with a SearchView. It seems that I can only get the count of all(visible and hidden) ListViewRows in the ListView. If you have a solution for this without using Hyperloop, I'd love to hear that as well.

      Thank you in advanced.

        Attachments

          Activity

            People

            • Assignee:
              jvennemann Jan Vennemann
              Reporter:
              James.OLeary James O'Leary
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-10498
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Integration