Hi to Everybody here.
I would like to know whether it exists a way to understand the type of Object arriving from CustomListView_ItemClick(index,Object). This need arises from the following situation:
I have a CustomListView populated by file names, and file Objects. Some of the objects are obtained using File.ListFiles(dir) , while others are obtained reading a folder on an SD card, with ExternalStorage management. In other words, some are "normal" files, others are ExternalFile. When I select an item, the CustomListView_ItemClick sends an object as the value parameter.
If I want to read the file, I have to use (I suppose) different managements and therefore I need to know the "type" of the object. In the first case I will read files with usual procedure, while for the external file i need to use ExternalStorage etc. (all this, of course, if I don't miss something, as usual..)
BTW there may exist other solutons. Maybe I can keep two separate lists, containing only the first and only the second type of file, as a support of the CustomListView, and manage the problem. Or I can use Exception management for a "dirtier" solution, trying to cast the externalFile etc.. These are not my first choices, of course.
Thanks in advance
I would like to know whether it exists a way to understand the type of Object arriving from CustomListView_ItemClick(index,Object). This need arises from the following situation:
I have a CustomListView populated by file names, and file Objects. Some of the objects are obtained using File.ListFiles(dir) , while others are obtained reading a folder on an SD card, with ExternalStorage management. In other words, some are "normal" files, others are ExternalFile. When I select an item, the CustomListView_ItemClick sends an object as the value parameter.
If I want to read the file, I have to use (I suppose) different managements and therefore I need to know the "type" of the object. In the first case I will read files with usual procedure, while for the external file i need to use ExternalStorage etc. (all this, of course, if I don't miss something, as usual..)
BTW there may exist other solutons. Maybe I can keep two separate lists, containing only the first and only the second type of file, as a support of the CustomListView, and manage the problem. Or I can use Exception management for a "dirtier" solution, trying to cast the externalFile etc.. These are not my first choices, of course.
Thanks in advance