Java Reference
In-Depth Information
public void destroyApp(boolean unconditional) {
if (mPlayer != null) {
mPlayer.close();
}
mEndNow = true;
synchronized(this) {
this.notify();
}
}
public void commandAction(Command c, Displayable s) {
if (c.getCommandType() == Command.EXIT) {
destroyApp(true);
notifyDestroyed();
}
else {
// Capture
synchronized(this) {
this.notify();
}
}
}
public void run() {
viewCamera();
while(!mEndNow) {
synchronized(this) {
try {
this.wait();
} catch (InterruptedException ex) {
// Ignore
}
if (!mEndNow)
try {
byte[] rawImg = mVidc.getSnapshot(null);
Image image = Image.createImage(rawImg, 0, rawImg.length);
mCapturedImgItem.setImage(image);
} catch (MediaException ex) {
continue;
}
}
}
}
Search WWH ::




Custom Search