Problem
If a ImageView with a remote image is displayed to the user for the first time when no internet connectivity is available, the remote image will also not show if it is displayed later on when internet connectivity is available.
Only after a restart of the application the remote image will show.
Titanium SDK 3.2.0 (HEAD)
Android 4.2.1
Nexus S
Test case
1. Run the app from the code below with the device in "flight mode" (no internet connectivity)
2. Press the button "Open". The remote image will not show as expected.
3. Go back with the back button.
4. Put the app into background (do not close the app completely)
5. Disable flight mode and wait for the internet connectivity to restore
6. Open the app.
7. Press the button "Open". I would now expect the remote image to appear. But it won't appear. It will only appear, if the app is fully closed and opened again.
var win = Ti.UI.createWindow({});
var b = Ti.UI.createButton({
title: 'Open'
});
win.add(b);
b.addEventListener('click', function(evt) {
var win2 = Ti.UI.createWindow({ modal: false });
var v1 = Ti.UI.createImageView({
height: '64dp',
width: '64dp',
hires: true,
backgroundColor: 'green',
image: "https://raw.github.com/appcelerator/titanium_mobile/master/android/templates/app/default/Resources/android/appicon.png",
});
win2.add(v1);
win2.open();
});
win.open();
Pull Request: https://github.com/appcelerator/titanium_mobile/pull/4307
Verified the fix we can see the image when internet connectivity is resumed. Thus closing. Environment: Appcel Studio : 3.2.0.201310221639 Ti SDK : 3.2.0.v20131022050844 Mac OSX : 10.8.5 CLI - 3.2.0 with hash 72f7426b4ee6c2d2883c666d5b7e03906a16012f Device: Samsung Galaxy S4 running android 4.2.2