the crossjoiner can't join when the right side is 11 and 21. I don't know why it show up after 1 and 2 of the left side. I think the cursor of the right side was supposed to wait until the cursor of the left side had got 11 and 21, respectively.
Using java Syntax Highlighting
- Cursor c = mDbHelper.query(mytable,new String[] {phoneId}, personId + "=" + myPersonId);
- Cursor cursorFromPhones = managedQuery(Phones.CONTENT_URI, new String[] {Phones._ID, Phones.NUMBER, Phones.TYPE, Phones.LABEL}, null, null, null);
- CursorJoiner pid_joiner = new CursorJoiner(cursorFromPhones, new String[] {Phones._ID}, c, new String[] {phoneId});
- for (CursorJoiner.Result joinerResult : pid_joiner) {
- switch (joinerResult) {
- case LEFT:
- System.out.println("LEFT");
- System.out.println(cursorFromPhones.getString(0));
- break;
- case RIGHT:
- System.out.println("RIGHT");
- System.out.println(c.getString(0));
- break;
- case BOTH:
- System.out.println("BOTH");
- System.out.println(c.getString(0));
- System.out.println(cursorFromPhones.getString(0));
- break;
- }
- }
Parsed in 0.034 seconds, using GeSHi 1.0.8.4
This is my logcat.
I/System.out( 2680): LEFT
I/System.out( 2680): 1
I/System.out( 2680): RIGHT
I/System.out( 2680): 11
I/System.out( 2680): LEFT
I/System.out( 2680): 2
I/System.out( 2680): RIGHT
I/System.out( 2680): 21
I/System.out( 2680): LEFT
I/System.out( 2680): 3
I/System.out( 2680): LEFT
I/System.out( 2680): 4
I/System.out( 2680): LEFT
I/System.out( 2680): 5
I/System.out( 2680): LEFT
I/System.out( 2680): 6
I/System.out( 2680): LEFT
I/System.out( 2680): 7
I/System.out( 2680): LEFT
I/System.out( 2680): 8
I/System.out( 2680): LEFT
I/System.out( 2680): 9
I/System.out( 2680): LEFT
I/System.out( 2680): 10
I/System.out( 2680): LEFT
I/System.out( 2680): 11
I/System.out( 2680): LEFT
I/System.out( 2680): 12
I/System.out( 2680): LEFT
I/System.out( 2680): 13
I/System.out( 2680): LEFT
I/System.out( 2680): 14
I/System.out( 2680): LEFT
I/System.out( 2680): 15
I/System.out( 2680): LEFT
I/System.out( 2680): 16
I/System.out( 2680): LEFT
I/System.out( 2680): 17
I/System.out( 2680): LEFT
I/System.out( 2680): 18
I/System.out( 2680): LEFT
I/System.out( 2680): 19
I/System.out( 2680): LEFT
I/System.out( 2680): 20
I/System.out( 2680): LEFT
I/System.out( 2680): 21

