1

Hey guys I have already made few apps and doing exactly the same this time though I am getting errors. Please check my logcat below

05-04 07:35:41.888: E/AndroidRuntime(1066): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.droidacid.count.COUNT }

This is my java code of main class

package com.droidacid.count;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class mainMenu extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main_menu);
    Button bapticalc = (Button) findViewById(R.id.bapticalc);


try{    
bapticalc.setOnClickListener(new View.OnClickListener() {

    @Override
    public void onClick(View v) {
        // TODO Auto-generated method stub

        startActivity(new Intent("com.droidacid.count.COUNT"));

    }
});
}

catch(Exception e)
{
    e.printStackTrace();
}



}


}

this is my apticalc class code

package com.droidacid.count;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;systemptiCalc extends Activity{


Button bnumsys;


@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.apticalc);

    bnumsys = (Button) findViewById(R.id.bnumsys);

    bnumsys.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            startActivity(new Intent("com.droidacid.count.SYS"));
        }
    });
}

}

And atlast this is my android manifest code

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.droidacid.apticalc"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".mainMenu"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <activity
        android:name=".count"
        android:label="@string/app_name"
         >
        <intent-filter>
            <action android:name="com.droidacid.count.COUNT" />

///////// This was the error...solved...while it should have been com.droidacid.apticalc.APTICALC

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


</application>

</manifest>

I am really sorry for such a long question guys but really wanted to state everything happening with me...Also I would really appreciate if someone would help me on how to check logcat properly for errors?

Note : Updated with actual code.

shivamDev31
  • 469
  • 1
  • 8
  • 23
  • it says the classes name is system and system isnt an activity in your manifest and your intents arent activitys to start – JRowan May 07 '13 at 22:02
  • You probably have an error now because you are referencing bapticalc. Which is not only not declared but also not initialized. You probably meant to write count there – DigCamara May 07 '13 at 23:00
  • Kind of difficult to diagnose anything when you obfuscate your code like that. Can you post the actual logcat as well, while you're at it? – DigCamara May 07 '13 at 23:04
  • I do understand that...Really sorry for that...BTW problem solved... Had to use com.droidacid.apticalc.APTICALC – shivamDev31 May 07 '13 at 23:09

2 Answers2

3

Your android manifest doesn't seem to have an intent-filter that catches com.droidacid.apticalc.APTICALC.

Change your second intent-filter to this:

    <intent-filter>
        <action android:name="com.droidacid.apticalc.APTICALC" />
        <action android:name="com.droidacid.apticalc.NUMBERSYS" />
        <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
CoderOfHonor
  • 741
  • 7
  • 17
  • Yeah, but it doesn't include the "com.example.droidacid.count.COUNT" action. – CoderOfHonor May 07 '13 at 22:25
  • He probably also needs to add a filter for `"com.droidacid.count.SYSTEM"` too. – CoderOfHonor May 07 '13 at 22:26
  • heh. I just was editing my answer to take that part into account. – DigCamara May 07 '13 at 22:31
  • Yeah might be I missed that...actually I have changed all these values after pasting it here...but that not the issue... – shivamDev31 May 07 '13 at 22:44
  • See the exact problem I am facing is that My app is opening...When I am clicking on the first button I am getting force close error...I have defined the activity of that button in AM.xml – shivamDev31 May 07 '13 at 22:48
  • did you look at my answer, @Shivam? You probably have an error now because you are referencing bapticalc. Which is not only not declared but also not initialized – DigCamara May 07 '13 at 22:57
  • Check the code now...Actually the previous one was totally confusing because I had changed some values...Now its the actual code – shivamDev31 May 07 '13 at 23:03
  • Any suggestion for this : http://stackoverflow.com/questions/16379090/wallpaper-app-code-optimazation – shivamDev31 May 07 '13 at 23:11
0

Seems to me there's an Activity missing in your Manifest. You're referencing com.droidacid.count.count in your Manifest (the .count in

  <activity
        android:name=".count"
        android:label="@string/app_name"
         >

is an extension to the package's name. The documentation states:

android:name The name of the class that implements the activity, a subclass of Activity. The attribute value should be a fully qualified class name (such as, "com.example.project.ExtracurricularActivity"). However, as a shorthand, if the first character of the name is a period (for example, ".ExtracurricularActivity"), it is appended to the package name specified in the element.

So you either change the name of your class or you change the content of your manifest. While I'm at it: you are calling startActivity(new Intent("com.droidacid.count.COUNT")); you need to change that to match the intent-filter in your manifest (as written it should be startActivity(new Intent("com.example.sweet_memories.COUNT"));).

DigCamara
  • 5,540
  • 4
  • 36
  • 47
  • @Shivam please post the actual logcat – DigCamara May 07 '13 at 23:08
  • @DigCamara - Bro you were really helpful . Problem solved and I am really feeling bad that I had to select his answer. Hope you wont mind that. Thanks really appreciate your effort. Really hope to get people like you to help me more on facebook or gtalk... – shivamDev31 May 07 '13 at 23:13
  • Important thing is that your problem's solved. For future reference: don't change around the code you're having trouble with, just post it here. Or else you end up having a lot of trouble getting actual help... – DigCamara May 07 '13 at 23:16