I've put a feature in my app that opens the contacts list. The problem is that some users reported that the app crashed when they tried to use it. The feature seems to works fine for most people(me included, with Nexus S).
Here's the code I've used to open the contacts -
call_friend.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent i = new Intent();
i.setComponent(new ComponentName("com.android.contacts", "com.android.contacts.DialtactsContactsEntryActivity"));
i.setAction("android.intent.action.MAIN");
i.addCategory("android.intent.category.LAUNCHER");
i.addCategory("android.intent.category.DEFAULT");
startActivity(i);
}
});
Here's the log of the crash -
android.content.ActivityNotFoundException: Unable to find explicit activity class {com.android.contacts/com.android.contacts.DialtactsContactsEntryActivity}; have you declared this activity in your AndroidManifest.xml?
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1404)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)
at android.app.Activity.startActivityForResult(Activity.java:2817)
at android.app.Activity.startActivity(Activity.java:2923)
at can.you.drive.dont_drive$1.onClick(dont_drive.java:75)
at android.view.View.performClick(View.java:2465)
at android.view.View$PerformClick.run(View.java:8907)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at dalvik.system.NativeStart.main(Native Method)
I don't know what's causing it. Thanks!