2017-01-09 2 views
0

Ich möchte eine andere App aus der App meines Appcelerators starten. Ich habe diesen Code gefunden, aber ich kann ihn nicht ändern.So starten Sie eine andere App aus der appcelerator-App

Meine App von appcelerator App mit dem Namen "Mobilität" zu öffnen.

Wie kann ich es starten?

EDIT: I have change my code in this but not works:

function launchAnotherApp(){ 
    var intent = Ti.Android.createIntent({ 
     action: Ti.Android.ACTION_MAIN, 
     className: 'it.mobility.LoginActivity', 
     packageName: 'it.mobility' 
    }); 
    intent.putExtra('username', "username"); 
    intent.putExtra('password', "password"); 
    //intent.addCategory(Ti.Android.CATEGORY_LAUNCHER); 
    Ti.Android.currentActivity.startActivity(intent); 
} 

dies ist der Fehler: {it.mobility/it.mobility.LoginActivity}; Hast du diese Aktivität in deiner AndroidManifest.xml deklariert?

Antwort

0

Ich glaube, Sie müssen diesen Code in Ihrem tiapp.xmlAndroid-Manifest-Anwendung Tag hinzuzufügen:

<activity android:label="@string/app_name" 
android:name="it.mobility.LoginActivity" /> 
0

Dieser Code funktioniert:

var intent = Ti.Android.createIntent({ 
     action : Ti.Android.ACTION_MAIN, 
     packageName: 'it.eresult.sweetmobility', 
     className : 'it.eresult.sweetmobility.activities.LoginActivity' 
    }); 
    //set input data 
    intent.putExtra('username', "user"); 
    intent.putExtra('password', "pass"); 

    Ti.Android.currentActivity.startActivity(intent); 
Verwandte Themen