我是开发玻璃的新手。我开发了一个应用程序来拍照并将语音提示返回给用户。默认情况下,应用程序/玻璃的性质,应用程序将拍照,然后一个选项显示它将要求用户点击接受拍摄的照片。该应用程序运行时间最长,完美无缺。但是,更新后Glass将不再注册水龙头。它会听到它,这意味着玻璃在点击时会产生,但没有任何事情会发生,应用程序不会进行下一步......
设备信息:XE19.1 - 最新
以下是代码:
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (RESULT_OK == resultCode) {
// want to do something after taking the picture?
// play opening sound
soundPool = new SoundPool(1, AudioManager.STREAM_MUSIC, 0);
soundID = soundPool.load(this, R.raw.bell, 1);
soundPool.setOnLoadCompleteListener(new SoundPool.OnLoadCompleteListener() {
@Override
public void onLoadComplete(SoundPool arg0, int arg1,
int arg2) {
soundPool.play(soundID, 1, 1, 1, 0, 1);
}
});
setContentView(R.layout.responding);
//index = readFromFile();
showMessageAndSpeak(text[index]);
//showMessageAndSpeak("The symbol you see on your dashboard is the Brake system warning signal. . . The light is on because your emergancy break is on. ");
writeToFile();
System.out.println("ONACTIVITY : " + count++);
}
super.onActivityResult(requestCode, resultCode, data);
}
以下是相关CameraActivity的代码:
public class CameraActivity extends Activity {
private SurfaceHolder surfaceHolder;
private Camera camera;
private boolean previewOn;
private final static int CAMERA_FPS = 5000;
TextToSpeech tts;
SoundPool soundPool;
int soundID;
int index = 0;
int count = 0;
String NOTES = "note.txt";
String[] text = {"Hello world",
"Hi world",
"Whats up world"};
public void onCreate(Bundle savedInstanceState) {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
index = readFromFile();
System.out.println("INDEX : " + index);
//writeToFile();
super.onCreate(savedInstanceState);
setContentView(R.layout.camera_preview);
// Set up the camera preview user interface
getWindow().setFormat(PixelFormat.UNKNOWN);
SurfaceView surfaceView = (SurfaceView) findViewById(R.id.camerapreview);
surfaceHolder = surfaceView.getHolder();
surfaceHolder.addCallback(new SurfaceHolderCallback());
// create tts
tts = new TextToSpeech(this, new TextToSpeech.OnInitListener() {
@Override
public void onInit(int status) {
if (status == TextToSpeech.ERROR)
Toast.makeText(getApplicationContext(), "TTS not working.",
Toast.LENGTH_SHORT).show();
}
});
//onDestroy();
}
知道发生了什么事吗?