inserting email address into ContactMethods table in 0.9 beta

by kingkung » Sat, 30 Aug 2008 09:46:07 GMT


Sponsored Links
 For whatever reason, I'm having trouble inserting email addresses into
the ContactMethods table in 0.9... the code worked perfectly fine in
m5.

The insert() call is successful (no exception), but it consistently
says that 0 rows have been inserted.  These are the values that I set
in my ContentValues object:

cv = new ContentValues();
cv.put(ContactMethods.KIND,KIND_EMAIL); //KIND_EMAIL is an integer (1)
cv.put(ContactMethods.PERSON_ID, ac.mobileID); //long
cv.put(ContactMethods.DATA, email.value); //string
cv.put(ContactMethods.TYPE, email.type); //integer btwn 0-3
int rows =
context.getContentResolver().bulkInsert(getMethodUri(personUri),generateAddressCVarray(ac));
Logger.log(rows);

private static Uri getMethodUri(Uri contactUri)
{
        return
contactUri.buildUpon().appendPath(ContactMethods.CONTENT_URI.getLastPathSegment()).build();
}

Is there something I'm missing or something else that I need to set?
As I said before, this worked perfectly fine in m5.


--~--~---------~--~----~------------~-------~--~----~



inserting email address into ContactMethods table in 0.9 beta

by kingkung » Sat, 30 Aug 2008 09:50:17 GMT


 Slightly confusing code... the ContentValues properties (below) are
set in the method generateAddressCVarray(), which generates an array
of CVs for each email address...

cv = new ContentValues();
cv.put(ContactMethods.KIND,KIND_EMAIL); //KIND_EMAIL is an integer (1)
cv.put(ContactMethods.PERSON_ID, ac.mobileID); //long
cv.put(ContactMethods.DATA, email.value); //string
cv.put(ContactMethods.TYPE, email.type); //integer btwn 0-3

...........

The following line is then called for a bulkInsert... and the rows
always come out as 0.  Even if I insert them one at a time, I get the
same result.

int rows =
context.getContentResolver().bulkInsert(getMethodUri(personUri),generateAddressCVarray(ac));
Logger.log(rows);

private static Uri getMethodUri(Uri contactUri)
{
 return
contactUri.buildUpon().appendPath(ContactMethods.CONTENT_URI.getLastPathSegment()).build();
}

Can anyone help?
--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


inserting email address into ContactMethods table in 0.9 beta

by Jeff Hamilton » Sat, 30 Aug 2008 09:54:14 GMT


 Does anything show up in the log when you see the failure?

-Jeff




--~--~---------~--~----~------------~-------~--~----~



inserting email address into ContactMethods table in 0.9 beta

by kingkung » Wed, 03 Sep 2008 01:21:31 GMT


 It's not a failure, it's just that 0 addresses are added.




--~--~---------~--~----~------------~-------~--~----~



inserting email address into ContactMethods table in 0.9 beta

by kingkung » Wed, 03 Sep 2008 04:09:11 GMT


 Never mind, my types are set to "0", and there is no "0" type anymore.





--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Mau Beli and terima pre order JTA

Buat para suhu, saya mau benerin htc magic saya yang matot karena salah
flash, berdasarkan tutorial di
http://wiki.cyanogenmod.com/index.php?title=JTAG_for_Dream/Magic, perlu
JTAG, dan disitu ada recommended JTAG, udah ada yang pernah coba? kalo ada
yang mau beli ayo beli rame-rame biar murah, saya mau bayar via PAYPAL, kalo
mau nitip silakan contact gtalk ane yaaaa

-- 
*sent from Froyo Android Htc Magic*

-- 
===============
"Indonesian Android Community [id-android]"

PING'S mobile
Email: sa...@pings-mobile.com  Ph. (021) 96087100
---------------------
Yopie Ratjoen
Email: yo...@ratjoen.com  Ph. 08977726681
--------------------
Gila original
Email: i...@gilaoriginal.com  Ph. (031) 91555898
--------------------

Aturan Jual/Kloteran ID-Android  http://goo.gl/azW7

2. SAP ABAP Interactive Online Training at BigClasses.com

* 100% JOB Oriented Training
* Attend Two FREE Trail Classes
* Affordable FEES with REAL TIME Trainers
* 3 Months Free SAP SERVER ACCESS

SAP ABAP course content:  http://bigclasses.com/cms/sap-technical/abap.html

BigClasses.com is a Global Interactive Online Learning Portal started
by proven SAP Experts with an aim to provide Quality Training in SAP
Modules.

ABOUT OUR FACULTY: We have excellent SAP ABAP instructors who have
Real Time experience plus expert orientation in Online Training.

TRAINING HIGHLIGHTS:
1. Interactive Learning at Learners convenience
2. Industry Savvy Trainers
3. Learn Right from Your Place
4. Customized Curriculum
5. Support after Training
A) Resume Preparation
B) Certification Guidance
C) Interview assistance

Guaranteed Placement Assistance for USA Learners
We have a forthcoming online batch on SAP ABAP
OTHER SAP TRAININGS OFFERED:
* SAP ABAP
* SAP BASIS
* SAP BW BI
* SAP FICO/MM/ SD &CRM

OTHER TRAININGS OFFERED:
* Data Warehousing
* IBM Mainframes
* Microsoft Technologies
* Testing Tools
Visit: www.bigclasses.com
CONTACT US:
cont...@bigclasses.com
USA: 1-302 525 2655
INDIA: 91-800 811 4040 for Career Advice
Skype ID: Gtalk ID: Yahoo ID: Hotmail ID: bigclasses

-- 

3. Buttons on Android Devices

4. Help : SG5 ngeHang

5. Animating different views during the same animation

6. memory fault detect application on Android platform

7. Salam Kenal mohon bimbingan...