Reputation: 1935
I am trying to use the ContactManager
from the Android developer website and when I press my button to go to the ContactManager
it shuts down and an exception is thrown:
throw new ActivityNotFoundException("No Activity found to handle " + intent);
It is under the switch(res)
so I am guessing that it is not connecting to the ContactManager
. Here is my button to the ContactManager
:
Button clas;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.friends);
SettingButtons();
clas.setOnClickListener(this);
}
public void onClick(View v) {
switch(v.getId()){
case R.id.TOFRIENDS:
startActivity(new Intent("com.clayton.calendar.ContactManager"));
break;
}
}
private void SettingButtons() {
clas = (Button) findViewById(R.id.TOFRIENDS);
}
My AndroidManifest
file is:
<activity android:name=".ContactManager" android:label="@string/app_name">
<intent-filter>
<action android:name="com.clayton.calendar.ContactManager" />
<category android:name="android.intent.category.Default" />
</intent-filter>
</activity>
<activity android:name="ContactAdder" android:label="@string/addContactTitle">
</activity>
In the ContactManager
I changed the package to package com.clayton.calendar
and in AddContact
I changed the following:
public static final String ACCOUNT_NAME = "com.clayton.calendar.ACCOUNT_NAME";
public static final String ACCOUNT_TYPE = "com.clayton.calendar.ACCOUNT_TYPE";
Is there anything else in it I have to change to get it to work? I have looked through the code a few times and I don't think I've missed anything.
Upvotes: 1
Views: 180
Reputation: 87064
The strings for the action
and category
elements of the <intent-filter>
tag are case sensitive so instead of :
<category android:name="android.intent.category.Default" />
use:
<category android:name="android.intent.category.DEFAULT" />
Upvotes: 1