Hi everyone,
Hope someone can help me with this problem... I'm trying to start a new activity using an intent, but a black screen always pops up at soon as I open the app, I'm getting my newIntent handlers and the data from the barcode correctly but nothing appears outside of the previous black screen.
I'm using the DataWedge API for Motorola devices (HW barcode integrated), the communication between my app and the API is by Intents. It seems that it's not possible to start a new activity by the app itself, is this possible using a module or by the same window activity?
var win = Ti.UI.createWindow({ backgroundColor:"red" title: "Barcode Window" }); win.addEventListener('open', function(e) { var intent = Ti.Android.createIntent({ action: "com.motorolasolutions.emdk.RECVR", className: "com.myproject.PocActivity", flags: Ti.Android.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED | Ti.Android.FLAG_ACTIVITY_SINGLE_TOP, }); Ti.Android.currentActivity.startActivity(intent); // Retrieve intent that launch the activity Ti.Android.currentActivity.addEventListener('newintent',function(e) { console.log("new Intent executed: " + JSON.stringify(e)); // ... I can handle correctly every extra from my intents }); });Here's part of my tiapp.xml with the activity:
<activity android:alwaysRetainTaskState="true" android:configChanges="keyboardHidden|orientation" android:hardwareAccelerated="true" android:launchMode="singleTop" android:name=".PocActivity" android:screenOrientation="portrait"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> <intent-filter> <action android:name="com.motorolasolutions.emdk.RECVR"/> <category android:name="android.intent.category.DEFAULT"/> </intent-filter> </activity>Titanium SDK 3.5.0.GA Platform Android 4.1.1 Device Motorola MC40