0

I am using Sony Smart eyeglasses sdk for a project. I have two layouts xml file and I am trying to get image from gallery displayed on the imageview of the layout.

I have obtained image location as a String, but how do I pass that image to the layout using Bundles?

moleculeone
  • 221
  • 3
  • 12

2 Answers2

0

HelloLayouts sample project in SmartEyeglass SDK, shows exactly how to achieve this.

You will see a bundle list parameter in showLayout method. You can add your images for different imageViews into this list. Then when you are displaying layout with showLayout method, you need to provide this bundle list as the second parameter.

You can see this in more detail in HelloLayouts sample project in the SDK. Please have a look at lines between 308 to 316 in HelloLayoutsControl.java file.

Max Abrahamsson
  • 1,460
  • 3
  • 17
  • 35
  • Based on your suggestion, the following works: imageBundle.putInt(Control.Intents.EXTRA_LAYOUT_REFERENCE, R.id.image1); imageBundle.putString(Control.Intents.EXTRA_DATA_URI, getUriString(R.drawable.test)); But I have to pass an image from the SD card, not the drawable folder. I have a String "imageLocation" which stores the full address of the image e.g, "/storage/emulated/..../image.jpg". I did the following but does not work: imageBundle.putInt(Control.Intents.EXTRA_LAYOUT_REFERENCE, R.id.image1); imageBundle.putString(Control.Intents.EXTRA_DATA_URI, imageLocation); – moleculeone May 31 '16 at 00:01
0

This did the trick : imageBundle.putString(Control.Intents.EXTRA_DATA_URI, "file:///" + imageLocation);

moleculeone
  • 221
  • 3
  • 12