0

I have problem with my manifest. When I try to open the second Activity, I get the error android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.xxxxx.monapplication.APPLICATION.OWNERREGISTRATION }

Find bellow my Manifest .xml contain

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.xxxxx.monapplication" android:versionCode="1" android:versionName="1.0" >
<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="23" />
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme" >
<activity android:name="com.xxxxx.monapplication.application.Accueil" >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>
<activity android:name="com.xxxxx.monapplication.application.OwnerRegistration" >
    <intent-filter>
        <action android:name="android.intent.action.APPLICATION.OWNERREGISTRATION" />
        <category android:name="android.intent.category.APPLICATION.DEFAULT" />
    </intent-filter>
</activity>

An the part of my code to open second activity

btnMel.setOnClickListener( new View.OnClickListener()
{
    @Override
    public void onClick(View v)
    {
        Intent i = new Intent("com.xxxxx.monapplication.APPLICATION.OWNERREGISTRATION");
        startActivity(i);
    }
} 

Please help me to find the error.

Richard
  • 560
  • 1
  • 8
  • 17
B Aristide
  • 67
  • 10

2 Answers2

0

You can call activity by its class name, then put your custom intent to setAction.

private String YOUR_ACTION = "com.xxxxx.monapplication.APPLICATION.OWNERREGISTRATION"

//uou can use this instead.
//Intent i = new Intent(this /* caller context */, OwnerRegistration.class);
Intent i = new Intent();
i.setAction(YOUR_ACTION);
startActivity(i);
ישו אוהב אותך
  • 28,609
  • 11
  • 78
  • 96
  • This thread could be related with your question: [Start Activity Using Custom Action](http://stackoverflow.com/questions/10921451/start-activity-using-custom-action) – ישו אוהב אותך Jun 20 '16 at 06:31
0

try this code..

Intent myIntent = new Intent(YourActivity.this, OWNERREGISTRATION.class); startActivity(myIntent); 
Muhammad Waleed
  • 2,517
  • 4
  • 27
  • 75