Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Programmatically launch an app in Android

$
0
0

I'm trying to launch from my app (app1) another app created with Titanium (app2) and installed on the device. Unfortunately I just can see only the splash screen of app2, but app1 still remain on the screen. This is my code:

try 
{
    var intent = Ti.Android.createIntent({
        action: Ti.Android.ACTION_MAIN,
        className: 'it.alessandrolarocca.app2.App2Activity',
        packageName: 'it.alessandrolarocca.app2'
    });
    intent.addCategory(Ti.Android.CATEGORY_LAUNCHER);
    Ti.Android.currentActivity.startActivity(intent);
} catch (error) {
    alert(error.message);
}
It works with:
className: 'com.android.calculator2.Calculator',
packageName: 'com.android.calculator2'
Where do I wrong?

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>