I have a thread that, when the current application closes, must start the main() method of another class.
I included ClassName.main(someStringArray) in the run() of the thread but the method wasn't called. What might have gone wrong?
The Thread I defined:
private class VideoCreator extends Thread{ public VideoCreator(){ pathToPass = savePath + "/" + "video.mov"; passVect.add("-w"); passVect.add("1280"); passVect.add("-h"); passVect.add("800"); passVect.add("-f"); passVect.add("25"); passVect.add("-o"); passVect.add(pathToPass); } @Override public void run(){ try{ jpegFiles = Files.newDirectoryStream(Paths.get(pathToPass).getParent(),"*.jpg"); for(Path jpegFile : jpegFiles){ passVect.add(jpegFile.toString()); } }catch(IOException e){ } try{ JpegImagesToMovie.main((String[])passVect.toArray()); }catch(Exception e){ System.out.println("Dammit Error!"); e.printStackTrace(); } } public void cleanUp(){ } String pathToPass; Vector<String> passVect = new Vector<>(100,200); DirectoryStream<Path> jpegFiles; }
java.util.Vectorclass'toArrayto aString[]. The Vector isVector<String>