我在原有的通讯录功能上面添加一个可以查看信息修改的记录,
思路如下:
这个记录单独定义一个activity,当在菜单中点击进入时候却进不去,
求解,我怀疑我的intent写错了:
<activity
android:name=".ContactLog"
android:label="@string/log_user">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
求解,哪里出了问题

解决方案 »

  1.   

    adb logcat看一下log。
    有异常解决异常。
    没异常,那就是你起activity的地方写的不对,不能满足启动ContactLog的条件。
      

  2.   

    他说的就是activity没找到
    <activity android:name=".ContactEditor"
    android:label="@string/edit_user">
    <intent-filter>
    <action android:name="android.intent.action.EDIT"/>
    <category android:name="android.intent.category.DEFAULT"/>
    <data android:mimeType="vnd.android.cursor.item/vnd.android.mycontacts"/>
    </intent-filter>
    <intent-filter>
    <action android:name="android.intent.action.INSERT"/>
    <category android:name="android.intent.category.DEFAULT"/>
    <data android:mimeType="vnd.android.cursor.dir/vnd.android.mycontacts"/>
    </intent-filter>
    </activity>
    <activity android:name=".contactView"
    android:label="@string/view_user">
    <intent-filter>
    <action android:name="android.intent.action.VIEW"/>
    <category android:name="android.intent.category.DEFAULT"/>
    <data android:mimeType="vnd.android.cursor.item/vnd.android.mycontacts"/>
    </intent-filter>
    <intent-filter>
    <category android:name="android.intent.category.DEFAULT"/>
    <data android:mimeType="vnd.android.cursor.dir/vnd.android.mycontacts"/>
    </intent-filter>
    </activity>
    <activity
    android:name=".ContactLog"
    android:label="@string/log_user">
    <intent-filter>
    <action android:name="android.intent.action.VIEW"/>
    <category android:name="android.intent.category.DEFAULT"/>
    </intent-filter>
    </activity>然后再主界面中:
    case LOGCONTACT_ID:
    startActivity(new Intent(Intent.ACTION_VIEW,getIntent().getData()));
    break;
    问下哪里问题