Titanium JIRA Archive
Appcelerator Community (AC)

[AC-436] Intent-filters not created for activities with url

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionNeeds more info
Resolution Date2015-12-07T09:22:51.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsactivities, activity, android, intent, intent-filter
ReporterGertjan Smits
AssigneeMostafizur Rahman
Created2015-03-10T09:15:11.000+0000
Updated2015-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>

Comments

  1. Shuo Liang 2015-03-30

    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.
       <android xmlns:android="http://schemas.android.com/apk/res/android">
           	<manifest>
           	<application android:icon="@drawable/appicon" android:label="URLScheme" android:name="UrlschemeApplication" android:debuggable="false" android:theme="@style/Theme.AppCompat">
       			<activity android:name=".UrlschemeActivity" android:label="@string/app_name" android:theme="@style/Theme.Titanium" android:configChanges="keyboardHidden|orientation|screenSize">
       				<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="myapp" android:host="test"/>
       				</intent-filter>
       			</activity>
       			<activity android:name="org.appcelerator.titanium.TiActivity" android:configChanges="keyboardHidden|orientation|screenSize"/>
       			<activity android:name="org.appcelerator.titanium.TiTranslucentActivity" android:configChanges="keyboardHidden|orientation|screenSize" android:theme="@style/Theme.AppCompat.Translucent"/>
       			<activity android:name="ti.modules.titanium.ui.android.TiPreferencesActivity" android:configChanges="screenSize"/>
       			<service android:name="com.appcelerator.analytics.APSAnalyticsService" android:exported="false"/>
       		</application>
       		</manifest>
           </android>
       
    Regards, Shuo
  2. Gertjan Smits 2015-03-30

    I see the difference. But this approach is not using the url attribute to define a JS activity.
  3. Sharif AbuDarda 2015-12-03

    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.

JSON Source