1. Are you ready for the Galaxy S20? Here is everything we know so far!

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

Discussion in 'Android Development' started by c2tarun, Apr 18, 2012.

  1. c2tarun

    c2tarun Newbie
    Thread Starter

    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??
     



    1. Download the Forums for Android™ app!


      Download

       
  2. c2tarun

    c2tarun Newbie
    Thread Starter

    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?
     
  3. aea

    aea Lurker

    From the android documentation...

    I don't know if that helps explain it any better or not :)
     
Loading...
Similar Threads - android content ActivityNotFoundException
  1. pro100umarchik
    Replies:
    4
    Views:
    267
  2. cocotus
    Replies:
    2
    Views:
    532
  3. Leodev
    Replies:
    1
    Views:
    463
  4. Dw1892
    Replies:
    2
    Views:
    459
  5. The_Chief
    Replies:
    4
    Views:
    419
  6. 20GT
    Replies:
    7
    Views:
    550
  7. Joshua Jackson
    Replies:
    2
    Views:
    461
  8. Veez999
    Replies:
    6
    Views:
    831
  9. MyPoorAndy
    Replies:
    1
    Views:
    602
  10. Chen Dol Dawd
    Replies:
    1
    Views:
    1,229

Share This Page

Loading...