I have two views.In first view, I have a table view and I am displaying remote data in its cells. I am showing activity indicator while data downloading.
Second view gets open when any of row is selected.
When I come back to the first view, I am refreshing the table view by downloading remote data.
But in Android, when I come back to first view and start downloading data, application gets crash due to activity indicator !!! Application crashes only in Android, its working fine in iPhone !!
I am refreshing the table's data in focus event of current window.
the error : -
Activity org.appcelerator.titanium.TiActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@450c4488 that was originally added here E/WindowManager( 324): android.view.WindowLeaked: Activity org.appcelerator.titanium.TiActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@450c4488 that was originally added here
and
(main) [2225,140482] Sending event: exception on thread: main msg:java.lang.IllegalArgumentException: View not attached to window manager; Titanium 1.8.1,2012/01/27 17:31,a24502a E/TiApplication( 324): java.lang.IllegalArgumentException: View not attached to window manager
EDITED
my code : -
var currentWindow = Titanium.UI.currentWindow;
var placeTableData = [] ;
var placeTableView = Titanium.UI.createTableView
({
data:placeTableData,
top:'0dp',
height:'365dp'
});
currentWindow.addEventListener('focus',winopened);
function winopened(e)
{
placeTableData = createRow();
}
function createRow()
{
currentWindow.add(activity);
activity.show();
currentWindow.touchEnabled = false;
// downloading data
if(loader1.DONE)
{
currentWindow.touchEnabled = true ;
activity.hide();
}
}