07-21-2013 11:25 PM
I'm trying to make a file selector popup screen that is able to load all files and has a search editfield at the top which will allow a user to search for whatever file they want instead of going throu all the folders and stuff.
Already have a working file selector popup screen but not sure how exactly do i implement the "search" part
07-22-2013 04:13 AM
I presume you have seen this:
You will notice that the code following provides a filter based on the extension input - you will just need to extend this filter processing based on the edit field you add:
if (currentFile.indexOf(_extensions[count]) != -1)
//There was a match, add the file and
You could make this dynamic - by searching every time the user changed the input characters. To trigger this you would have a FieldChangedListener on the edit field.
However I think a Button or the 'enter' key is more user friendly. You can detect 'enter' by having a KeyListener on the edit Field.