When I tried my android application developed in Titanium on galaxy s3 it was just opening for a second and than closing without any error. Realizing that if was fault of "Do not keep activities" under "Developer options", after some researches I anded up here: https://jira.appcelerator.org/browse/TIMOB-12939. If I uncheck "Do not keep activities" everything works fine. Now,I want to make it work though the "Do not keep activity" us checked, in the link above I read that Titanium documentation talks about this, so I ended up here: http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.Android.Activity. So I changed my code from
if (OS_ANDROID) {
Alloy.createController('home').getView().open(); }
to
var intent = Ti.Android.createIntent({
action: Ti.Android.ACTION_MAIN,
url:'home.js'
});
intent.addCategory(Ti.Android.CATEGORY_LAUNCHER);
Ti.Android.currentActivity.startActivity(intent);
thinking that probably I can not use a simple open, like(win.open()) and it crushed because the activity was not declared in manifest. Actually, I did not find a good example on how to work with activities and tiapp.xml, how to add them? So I tried something, probably stupid, in tiapp.xml I added:
<activity android:name=".HomeActivity" url="home.js"/>
and what I get is:
Unable to instantiate activity ComponentInfo{it.trenta.mobile/it.trenta.mobile.HomeActivity}: java.lang.ClassNotFoundException: it.trenta.mobile.HomeActivity
So, how can I declare an activity in Titanum? Is there any way to avoid this checkbox affect your app (apart unchecking it :) )?
Thanks in advance for any help!