Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8334887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:29:35+00:00 2026-06-09T03:29:35+00:00

Before I ask my question I saw android intent filter? and Android: Activity not

  • 0

Before I ask my question I saw android intent filter? and Android: Activity not registered in the manifest also I searched this ,but I could not find my answer.
In my App,I have to start Activty1 form IntentFilterActivity(both are Activities) with implicit Intent.Here is my code:

  • Manifest

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.your.namespace"
    android:versionCode="1"
    android:versionName="1.0" >
    
    <uses-sdk android:minSdkVersion="2" />
    
    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:label="@string/app_name"
            android:name=".IntentFilterActivity" >
            <intent-filter >
                <action android:name="android.intent.action.MAIN" />
    
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:label="Activity1"
            android:name="com.your.namespace.Activity1" >
            <intent-filter >
                <action android:name="com.your.namespace.MY_MAIN"/>
    
                <category android:name="com.your.namespace.MY_LAUNCHER"/>
            </intent-filter>
        </activity>
    </application>
    
    </manifest>
    
  • IntentFilterActivity

    package com.your.namespace;
    
    public class IntentFilterActivity extends Activity {
    protected String action = "com.your.namespace.MY_MAIN";
    protected String category = "com.your.namespace.MY_LAUNCHER";
    
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Button b1 = (Button) findViewById(R.id.button1);
        b1.setOnClickListener(new OnClickListener() {
    
            @Override
            public void onClick(View v) {
    
                Intent i = new Intent(IntentFilterActivity.this,Activity1.class);
                IntentFilterActivity.this.startActivity(i);
            }
        });
    
        Button b2 = (Button) findViewById(R.id.button2);
        b2.setOnClickListener(new OnClickListener() {
    
            @Override
            public void onClick(View v) {
                Intent i = new Intent();
                i.setAction(action);
                i.addCategory(category);
                IntentFilterActivity.this.startActivity(i);
            }
        });
    }
    }       
    
  • Activity1

    package com.your.namespace;
    
    public class Activity1 extends Activity {
    
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main1);
    }
    }
    

First I had one button(say b2) in R.layout.main and in it’s onClick event I tried to start Activity1 with implicit Intent.But when I click it I get this error:

android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.your.namespace.MY_MAIN cat=[com.your.namespace.MY_LAUNCHER] }

So I added another Buuton(say b1) to R.layout.main and in it’s onClick event,I tried to start Activity1 with explicit Intent and Activity1 started fine.So my problem is in about registering Activity1 in manifest.
I tried to change package name,clean/build project,creating a new project and starting from there,importing the project in eclipse on a different computer,restarting eclipse and … but I get error.My project has only one package(com.your.namespace).
What do I do wrong?Please help me to solve this problem.
Edit:
When I change Intent filter of Activty1 to this:

<intent-filter >
        <action android:name="android.intent.action.MAIN" />

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

and run App, Application’s icon appears twice in Launcher!This is strange,one intent filter seems to be ignored and another filter,not.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T03:29:37+00:00Added an answer on June 9, 2026 at 3:29 am

    try this:

    <activity
        android:label="Activity1" android:name="com.your.namespace.Activity1" >
        <intent-filter >
            <action android:name="com.your.namespace.MY_MAIN"/>
    
            <category android:name="android.intent.category.DEFAULT"/>
        </intent-filter>
    </activity>
    

    notice the change: android.intent.category.DEFAULT

    Should work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried to ask this question before but I guess I didnt explain myself
I don't know if this question has been ask before. But I have a
Pretty new here. But before I ask my question, I'm not looking for teh
This is maybe a stupid question, but I figured I'd ask before I did
I tried to ask this question once before, but nobody understood what I want
I'm embarrassed to even ask this question, but not sure of the syntax or
Before I ask my question, let me get this straight... This is not a
Before I ask this question I would to apologise because of the fact that
Before you guys ask, yes I've searched online for the answer, but everything I
I did ask a question before. The answer made sense, but I could never

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.