Titanium:如何在 Android 的电话簿中添加联系人? [英] Titanium: How to add Contact in Phone book in Android?

查看:25
本文介绍了Titanium:如何在 Android 的电话簿中添加联系人?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在电话簿中添加联系人.我可以在 iPhone 中正确添加联系人,但在文档中我知道在 Android 中,电话簿是 只读 !!!

I want to add Contacts in phone book. I can add contacts in iPhone properly but in documentation I got to know that in Android, phone book is ReadOnly !!!

还有其他方法可以添加吗?

Is there any other way to add ?

谢谢..

推荐答案

已解决!我从这个链接 .我们可以通过 Intent 在 Android 中添加联系人.

Solved ! I got help from this Link . We can add contacts in Android by Intent.

if (Titanium.Platform.name == 'android') 
            {
                var intent = Ti.Android.createIntent
                ({
                    action: 'com.android.contacts.action.SHOW_OR_CREATE_CONTACT',
                    data: 'mailto:'+firstName+' '+lastName
                });
                    intent.putExtra('email', email);
                    intent.putExtra('email_type', 'Work');
                    intent.putExtra('phone', mobileno);
                    intent.putExtra('phone_type', 'mobile');
                    intent.putExtra('name', firstName+' '+lastName);

                Ti.Android.currentActivity.startActivity(intent);
            }

这篇关于Titanium:如何在 Android 的电话簿中添加联系人?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆