Sometimes (about half the time) when I install my app on the emulator or on a device, the app opens with no tabs, just a grey bar, and a black screen underneath, when there should be 4 tabs.
I'm not posting any code as there are no errors that indicate what the problem might be. The only thing I can think of is 3 of tabs contain remote content using httpclient. Could it be there is too much going on and this is preventing the tabs loading. On iOS I don't get any such issues.
The only message I get in console are the following, but not sure if they are related to the problem or not.
[WARN][TiTabActivity( 937)] (main) [396,891] Notifying TiTabGroup, activity is created [WARN][InputMethodManagerService( 147)] Got RemoteException sending setActive(false) notification to pid 690 uid 10048 [INFO][ActivityManager( 147)] Displayed com.plug.membership/ti.modules.titanium.ui.TiTabActivity: +3s645ms (total +10s99ms) [WARN][ActivityManager( 147)] Activity idle timeout for ActivityRecord{4145efe8 com.plug.membership/.PlugMembershipActivity}
Titanium SDK version: 2.1.3
Titanium Studio, build: 2.1.2.201208301612
Mac OSX 10.7.5
Emulator and Android Device
3 Answers
i can see something like here,
Displayed com.plug.membership/ti.modules.titanium.ui.TiTabActivity: +3s645ms (total +10s99ms) [WARN][ActivityManager( 147)] Activity idle timeout for ActivityRecord{4145efe8 com.plug.membership/.PlugMembershipActivity}so Activity Idle timeout, means this might be happening when http request take time.
if this is the case,try to open the tab group once the http response is received?
It happens to me exactly the same... Did you find any solution to this?
Thank you Ashish, I think that is the problem.
The next code works just fine:
app.jsvar ApplicationTabGroup = require('ui/common/ApplicationTabGroup');
new ApplicationTabGroup().open();
ApplicationTabGroup.jsfunction ApplicationTabGroup(Window) {
var self = Ti.UI.createTabGroup();
var Main = require('ui/handheld/main');
//create app tabs
var win1 = new Main(L('titleWindow'));
var tab1 = Ti.UI.createTab({
title: L('railaodinga'),
icon: '/images/icon.png',
window: win1
});
win1.containingTab = tab1;
self.addTab(tab1);
return self;
};
module.exports = ApplicationTabGroup;
main.jsfunction MainWindow(title) {
var self = Ti.UI.createWindow({
backgroundColor:'#fff'
});
var data = [];
var tableview = Titanium.UI.createTableView({});
self.add(tableview);
loadArticles();
function loadArticles()
{
tableview.setData([]);
var xhr = Titanium.Network.createHTTPClient();
xhr.onload = function()
{
try
{
var doc = this.responseXML.documentElement;
var items = doc.getElementsByTagName('item');
var urls = new Array();
for(var c=0; c<items.length;c++)
{
// Append row to tableview
}
}
catch(E)
{
alert("Error retrieving the news");
}
};
xhr.open('GET', 'http://test.com/?xml');
xhr.send();
}
Ti.App.addEventListener('refreshNews', function()
{
loadArticles();
});
return self;
};
module.exports = MainWindow;
Here I call the url to retrieve the XML info?
Do you know how could I load the XML before create the ApplicationTabGroup??
Thank you very much in advance.
Your Answer
Think you can help? Login to answer this question!