hi guys.
i've created a multimedia player with slideshow where you can view next image by pressing left(keyCode -3) or right(-4) navigation button --> at least after viewing/playing an video/image.
below is my code form left keypress... (the right one would be just like this one)
case -3:
if(!this.back && this.parent.mainMenu.selectedMenu == 0 && this.fileList.size() > 0)
{
boolean found = false;
this.pos = this.currentFile;
do
{
if(this.currentFile > 0)
this.currentFile--;
else
this.currentFile = this.fileList.size() - 1;
if(this.currentFile == this.pos)
break;
String file = (String)this.fileList.elementAt(this.currentFile);
if(file.equals(".."))
continue;
int temp = file.lastIndexOf('.');
if(temp > -1)
{
String ext = file.substring(temp + 1, file.length());
if(Definition.videoMimeTable.containsKey(ext) |Definition.imageMimeTable.containsKey(ext))
found = true;
}
else
found = false;
}while(!found);
if(found)
{
//this.navLeft = true;
this.closePlayer();
this.preparePlayer((String)this.fileList.elementAt(this.currentFile));
//this.repaint(); testing juga ah
}
}
break;
FYI, i'm retrieving these files from the phone memory (using FileConnection)
the problem/error is that sometimes after i pressed right/left key it wont open/play the next/previous file..
but when i try to view the file one by one (not using slideshow feature) - it work.
please help me..i dont know what to do anymore..


Reply With Quote

