在新的联系人自定义字段自定义、字段、联系人

2023-09-04 12:19:55 作者:冷不过人性、凉不过人心

这是添加新联系人窗口。是否有可能在此窗口中创建自定义数据字段?

This is the 'add new contact' window. Is it possible to create custom data fields in this window?

我目前的自定义字段只有联系方式窗口可见。

My current custom fields are only visible on the 'contact details' window.

推荐答案

有可能推出一个新的添加新联系人的活动,当用户点击添加新联系人按钮。对于你必须创建自己的活动和的setContentView(R.layout.YOUR_CUSTOM_ACTIVITY_SCREEN)。现在,下一个步骤是重要的。以下行添加到您的应用程序的ManifestFile:

It is possible to launch a new Add New Contact activity when the user clicks on the add new contact button. For that you will have to create your own activity and setContentView(R.layout.YOUR_CUSTOM_ACTIVITY_SCREEN). Now the next step is important. Add the following lines to the ManifestFile of your application:

<activity android:name=".YOUR_CUSTOM_ACTIVITY" >
        <intent-filter>
            <action android:name="android.intent.action.INSERT" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:mimeType="vnd.android.cursor.dir/contact"/>
        </intent-filter>
    </activity>

现在,当用户点击添加,他会显示两个选项一个新的联系人。一会是您的应用程序和其他将是默认的活动添加联系人。

Now when the user click to add a new contact he will be shown 2 options. One will be your application and other would be the default activity to add contact.

希望这个答案可以帮助。

Hope this answer helps.

 
精彩推荐