newtonandebe / opendatakit

Automatically exported from code.google.com/p/opendatakit
0 stars 0 forks source link

ImageWidget crash #150

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Take a photo
2. When return from photo capture Image Widget crashes
3.

What is the expected output? What do you see instead?

Image should be displayed in the ImageWidget

What version of the product are you using? On what operating system?

1.1.4 ODK Collect

Android 2.1 update 1 (merged into our code)

Please provide any additional information below.

The root cause is method setEnabled(boolean).  What is happening is in the 
buildViewBodyImpl() method only if (mBinaryName != null) { passes does the 
local value mImageView get created.

To fix this change the code as follows:

In the buildViewBodyImpl() method just before if (mBinaryName != null) {

// create the image view but do not display yet
mImageView = new ImageView(getContext());
addView(mImageView);
mImageView.setVisibility(View.GONE);

remove these lines from buildViewBodyImpl()

mImageView = new ImageView(getContext());
...
addView(mImageView);

In the method updateViewAfterAnswer() in section if (mBinaryName != null) {

add this code

// there is an image to display show it
mImageView.setVisibility(View.VISIBLE);

in the same section ... else {

add this code:

// nothing to show hide the image view
mImageView.setVisibility(View.GONE);

This fixes the issue

Original issue reported on code.google.com by stevepot...@gmail.com on 15 Nov 2010 at 2:49

GoogleCodeExporter commented 9 years ago

Original comment by wbrune...@gmail.com on 15 Nov 2010 at 9:56

GoogleCodeExporter commented 9 years ago
This should be fixed (as of Nov 9 - 
http://code.google.com/p/opendatakit/source/detail?r=64bc68d397e0ce3a4a413ca8503
c19d9c8ebe2a0&repo=collect ).  Please pull the latest default tip, and try 
again.  

Note that the default tip is now properly identified as the 1.1.6 tree (was 
erroneously 1.1.4).  This is the active development tip.  If you want a more 
stable branch, choose the 1.1.5 branch; it is our stable release branch.

The 1.1.6 tree has splash screen, form logos, multiple-questions-per-page and 
icon-only selection support.

Original comment by mitchellsundt@gmail.com on 15 Nov 2010 at 10:34