intentfilter - Unable to open 2nd app using Custom Intent Action in Android -


i have written 1 application handles specific intent filters, here manifest of application:

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"     package="com.company.sampleapp"     android:versioncode="1"     android:versionname="1.0" >      <uses-sdk         android:minsdkversion="15"         android:targetsdkversion="17" />      <application         android:allowbackup="true"         android:icon="@drawable/ic_launcher"         android:label="@string/app_name">         <activity             android:name="com.company.sampleapp.mainactivity"             android:enabled="true"             android:exported="true"             android:label="@string/app_name" >              <!-- 1 filter -->             <intent-filter>                 <action android:name="com.company.sampleapp.action_do_something_1" />                  <category android:name="android.intent.category.default" />             </intent-filter>              <!-- 2 filter -->             <intent-filter>                 <action android:name="com.company.sampleapp.action_do_something_2" />                  <category android:name="android.intent.category.default" />             </intent-filter>              <!-- default filter -->             <intent-filter>                 <action android:name="android.intent.action.main" />                  <category android:name="android.intent.category.launcher" />             </intent-filter>         </activity>         <activity             android:name="com.company.sampleapp.seconf=dactivity"             />     </application> </manifest> 

i calling application second application using following code:

intent = new intent("com.company.sampleapp.action_do_something_1"); startactivityforresult(i, 100); 

i have tried:

intent = new intent(); i.setaction("com.company.sampleapp.action_do_something_1"); startactivityforresult(i, 100); 

but everytime,i getting following exception:

07-18 14:22:56.234: e/androidruntime(12051): caused by: android.content.activitynotfoundexception: no activity found handle intent { act=com.company.sampleapp.action_do_something_1 } 

please help.

i think missing <data android:mimetype="..."/> <intent-filter>.

try

<intent-filter>   <action android:name="com.company.sampleapp.action_do_something_1" />   <data android:mimetype="*/*"/>   <category android:name="android.intent.category.default" /> </intent-filter> 

read more allowing other apps start activity


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -