I modified the StopWatch demo application for Glass to start working with the camera on demand when the side is being listened. The intent code is copied from the Google documentation.
When I click, the onPause callback for my application starts, but the screen goes black, not the cameraβs preview. Pressing it again does nothing - onResume is not called. However, scrolling brings me back to StopWatch activity.
Is this like a bug with a camera aimed at Glass, or is it something at my end?
Stopwatch operation
private static final int CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE = 100;
AndroidManifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.google.glass.samples.stopwatch" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="15" android:targetSdkVersion="15" /> <uses-feature android:name="android.hardware.camera" /> <application android:allowBackup="true" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" > <activity android:name="com.google.glass.samples.stopwatch.StopWatchActivity" android:label="StopWatch" > <intent-filter> <action android:name="android.intent.action.MAIN" /> </intent-filter> </activity> </application> </manifest>
Logcat
470 862-862/com.google.glass.samples.stopwatch D/GOOGLE1: Touched side 470 862-862/com.google.glass.samples.stopwatch D/GOOGLE1: Pause 533 862-862/com.google.glass.samples.stopwatch D/OpenGLRenderer: Flushing caches (mode 1) 611 190-216/? I/ActivityManager: Displayed com.google.glass.camera/.CameraApiActivity: +142ms 619 862-862/com.google.glass.samples.stopwatch D/OpenGLRenderer: Flushing caches (mode 0) 142 190-213/? I/power: *** set_screen_state 0
source share