I have an HTML file in my res/raw that I want to view in the Google glass browser.
This answer suggests either copying to shared storage or using a WebView.
I cant seem to make the WebView scroll using the touchpad in the same way the browser does, which renders it useless for my purposes.
I tried copying the file to shared storage (i.e. /mnt/sdcard/Android/data/my.namespace/files/page.html) and using
Intent i = new Intent(Intent.ACTION_VIEW);
File file = new File(f.getAbsolutePath());
String extension = android.webkit.MimeTypeMap.getFileExtensionFromUrl(Uri.fromFile(file).toString());
String mimetype = android.webkit.MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
i.setDataAndType(Uri.fromFile(file),mimetype);
but I get this exception:
03-18 17:58:53.338: E/AndroidRuntime(5315): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=file:///mnt/sdcard/Android/data/my.namespace/files/page.html typ=text/html }
I've checked with adb shell and the file is at that location. Any ideas why this may not be working? Is it a glass specific issue?
Thanks