Skip to content

Commit 8ae1dda

Browse files
authored
Change SceneViewer intent setup
1 parent 9d62789 commit 8ae1dda

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

xr/src/main/java/com/example/xr/scenecore/GltfEntity.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,18 @@ private fun animateEntity(gltfEntity: GltfModelEntity) {
5151
private fun ComponentActivity.startSceneViewer() {
5252
// [START androidxr_scenecore_sceneviewer]
5353
val url =
54-
"https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/FlightHelmet/glTF/FlightHelmet.gltf"
54+
"https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/Avocado/glTF/Avocado.gltf"
5555
val sceneViewerIntent = Intent(Intent.ACTION_VIEW)
5656
val intentUri =
5757
Uri.parse("https://arvr.google.com/scene-viewer/1.2")
5858
.buildUpon()
5959
.appendQueryParameter("file", url)
6060
.build()
61-
sceneViewerIntent.setDataAndType(intentUri, "model/gltf-binary")
62-
startActivity(sceneViewerIntent)
61+
sceneViewerIntent.setData(intentUri)
62+
try {
63+
startActivity(sceneViewerIntent)
64+
} catch (e: ActivityNotFoundException) {
65+
// There is no activity that could handle the intent.
66+
}
6367
// [END androidxr_scenecore_sceneviewer]
6468
}

0 commit comments

Comments
 (0)