I am programming an application with Phonegap & Sencha Touch for Android.
I have a problem with the setActiveItem method of Sencha Touch and dbtransaction of Phonegap.
Here a simple example of my problem :
The function ALWAYS alert ‘OK’, but the application crashes on the setActiveITem method.
(without the setActiveItem, it works perfectly, and out of the db.transaction function, setActiveItem works perfectly)
I don’t understand why …
db.transaction(
requestFunction,
function(err){
alert("Error processing SQL: "+err.code);
},
function(){
alert('ok');
viewport.setActiveItem('home');
);
It is hard to know exactly the problem without more code, but I would say it is either because:
homedoes not exist.To help debug the issue, I suggest you set lots of alert()’s and figure out of
viewportactually exists, and if it does, then check ofhomeexists. If they both do, perhaps try setting the active item somewhere else in the code.