[AC-436] Intent-filters not created for activities with url
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Needs more info |
Resolution Date | 2015-12-07T09:22:51.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | activities, activity, android, intent, intent-filter |
Reporter | Gertjan Smits |
Assignee | Mostafizur Rahman |
Created | 2015-03-10T09:15:11.000+0000 |
Updated | 2015-12-07T09:22:51.000+0000 |
Description
I'm trying to register an Activity from a url. I can do this by adding the following the the section in tiapp.xml. Right?
<activities>
<activity url="myActivity.js">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="tryout"/>
</intent-filter>
</activity>
</activities>
I want to be able to start this activity from links clicked in other applications, so I added the scheme part. The problem is that the complete intent-filter part seems to be ignored.
Am I trying something weird? Shouldn't this be possible? If not, is there another way to do this?
The generated AndroidManifest.xml looks like this (removed the parts not needed for this case).
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.company.tryout" android:versionCode="1" android:versionName="1.0.0" android:installLocation="auto">
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="21"/>
<application android:icon="@drawable/appicon" android:label="Try Out" android:name="TryOutApplication" android:debuggable="false" android:theme="@style/Theme.AppCompat" android:hardwareAccelerated="true" android:largeHeap="true">
<!--- set of Titanium activities -->
<activity android:name="com.company.tryout.MyActivityActivity" android:configChanges="keyboardHidden|orientation|screenSize"/>
</application>
<!--- set of permissions -->
</manifest>
Hi, There are two things you may notice: 1. You have to clean the project, every time you modify the tiapp.xml file. otherwise, the change will not be applied. 2. Please compare my example with yours(only the android part of tiapp.xml file), see if there any difference. Specially, the tag layout.
Regards, Shuo
I see the difference. But this approach is not using the url attribute to define a JS activity.
Hello [~gertjans], Please follow the steps on the link [URI Intent Filter Example](https://wiki.appcelerator.org/display/guides2/Android+Intent+Filters#AndroidIntentFilters-URIIntentFilterExample). See that if it helps you. Also, what's in your "myActivity.js" file. Please reply if you are still facing the issue. Thanks.