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. Scroll view scrolling

Hi at all,

I am currently developing an activity which allow user to send a
feedback, the layout is composed in this way:
<ScrollView android:id="@+id/feedback_scroll_container"
                                                        
android:layout_height="wrap_content"
                                                        
android:layout_width="fill_parent"
                                                        
android:scrollbars="none"
                                                    android:clipChildren="true"
                                                        
android:layout_centerHorizontal="true"
                                                    
android:layout_below="@id/feedback_button"

                                                >
<EditText
                                                android:id="@+id/feedback_email"
                                        android:layout_width="fill_parent"
                                        android:layout_height="wrap_content"
                                        
android:background="@android:drawable/editbox_background"
                                        
android:layout_below="@id/feedback_text_email"
                                     />
<EditText
                                                
android:id="@+id/feedback_comment"
                                        android:layout_width="fill_parent"
                                        android:layout_height="100dp"
                                        
android:background="@android:drawable/editbox_background"
                                        
android:layout_below="@id/feedback_text_comment"
                                     />
</ScrollView>

When users focus the second edittext field the keyboard hide field and
users cannot see what are typing..
I try to force the scroll of my view in onFocusChange() functions
associated at the second field but scrollview do nothing!

What's wrong?


-- 

2. Porting android to AT91SAM9261-EK

Hello,

I'm working on AT91SAM9261EK board, i want to port Android on my atmel
board, i have already booted linux on my board. Now my task is to
bring up android, i dont know anything about android.

Please some one help me to bring Android on AT91SAM9261EK board.
I want to know what all the steps to be followed.

As i have already ported linux on my device, so i want to know HOWTO
port android.

Please help.

Best Regards
Akash Guttedar

-- 

3. How to declare device as "hdpi " even when it's not鈥?脿 la Galaxy Tab

4. Downloading a particular software component of a particular branch

5. Determining the subset of text that is visible in a TextView

6. Simple code hangs the android emulator.

7. Layout: Battery usage bar