Home Forum

Apps android.content.ActivityNotFoundException: No Activity found to handle Intent

Hi friends,
I am trying to activate an activity from another activity using implicit intent.

Code fragment of mail activity:

Code (Text):
  1. public void onClick(View view) {
  2.         intent = new Intent(Intent.ACTION_SEND);
  3.         int id = view.getId();
  4.         switch (id) {
  5.         case R.id.addButton: {
  6.             date = reminderDate.getDayOfMonth();
  7.             month = reminderDate.getMonth();
  8.             year = reminderDate.getYear();
  9.  
  10.             hour = reminderTime.getCurrentHour();
  11.             minute = reminderTime.getCurrentMinute();
  12.  
  13.             Log.d(TAG, String.format("%s, Date: %s/%s/%s, Time: %s:%s",
  14.                     reminderText.getText().toString(), date, month, year, hour,
  15.                     minute));
  16.             intent.setType("plain/text");
  17.             intent.putExtra("reminderText", reminderText.getText().toString());
  18.             startActivity(intent);
  19.             break;
  20.  
  21.         }
  22.         case R.id.cancelButton: {
  23.  
  24.             Log.d(TAG, "Reminder Cancelled");
  25.             Toast.makeText(this, "Reminder Cancelled", Toast.LENGTH_LONG)
  26.                     .show();
  27.             break;
  28.  
  29.         }
  30.         }
  31.     }
Androidmainfest.xml

Code (Text):
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
  3.     package="com.reminder"
  4.     android:versionCode="1"
  5.     android:versionName="1.0" >
  6.  
  7.     <uses-sdk android:minSdkVersion="10" />
  8.  
  9.     <application
  10.         android:icon="@drawable/ic_launcher"
  11.         android:label="@string/app_name" >
  12.         <activity
  13.             android:name=".QReminderActivity"
  14.             android:label="@string/app_name" >
  15.         </activity>
  16.         <activity android:name=".TimerActivity" >
  17.             <intent-filter>
  18.                 <action android:name="android.intent.action.MAIN" />
  19.  
  20.                 <category android:name="android.intent.category.LAUNCHER" />
  21.             </intent-filter>
  22.         </activity>
  23.         <activity android:name=".NotificationActivity" >
  24.             <intent-filter>
  25.                 <action android:name="android.intent.action.SEND" />
  26.                 <data android:mimeType="plain/text"/>
  27.             </intent-filter>
  28.         </activity>
  29.     </application>
  30.  
  31. </manifest>
Activity NotificationActivity is in proper place. But on clicking addButton I am getting following exception:

Can anyone please help me in finding the issue??
 

Related:

#1 c2tarun, Apr 18, 2012
I added following line to AndroidManifest.xml and it worked :(

<category android:name="android.intent.category.DEFAULT"/>

I may have a working code but can anyone please explain me why this happened?
 
#2 c2tarun, Apr 18, 2012
From the android documentation...

I don't know if that helps explain it any better or not :)
 
#3 aea, Apr 18, 2012