Media = MediaManager.createMediaRecorder("filename.xyz", MediaManager.getMediaRecorderingMimeType());
Button doneButton = new Button("DONE");
doneButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
stopRecord(false);
}
});
public void stopRecord(boolean timeElapsed)
{
answertiming.cancel();
media.pause();
media.cleanup();
if(timeElapsed)
Dialog.show("SUCCESS","Your time is up system has saved your answer, The file path for the recording is " + p, "OK",null);
else
Dialog.show("SUCCESS","You have successfully answered the question System has saved your answer, The file path for the recording is " + p, "OK",null);
}
我现在的方法是在这个f.e.周围放置一个3秒的计时器
UITimer timer = new UITimer(new Runnable() {
@Override
public void run() {
stopreRecord(true);
});
timer.schedule(3000, false, f);
# 1 楼答案
我在另一个线程上发现了这个,还没有经验,但这可能会帮助你
我现在的方法是在这个f.e.周围放置一个3秒的计时器
# 2 楼答案
目前,除了使用本机接口功能与本机OS http://www.codenameone.com/how-do-i -access-native-device-functionality-invoke-native-interfaces.html集成之外,在Codename One中无法实现这一点