各位大哥:小弟对android 问题追踪调试不是很懂,最近系统出现一个Bug,日历弹出一个错误 在Android系统上, :
java.lang.NullPointerException: 
at com.android.providers.calendar.CalendarSyncAdapter.onAccountsChanged(CalendarSyncAdapter.java:1400)
at android.content.AbstractSyncableContentProvider$1.onAccountsUpdated(AbstractSyncableContentProvider.java:187)
at android.accounts.AccountManager$10.run(AccountManager.java:826)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4325)
at java.lang.reflect.Method.invokeNative(Method.java:-2)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
追踪代码到1400 行
public void onAccountsChanged(Account[] accountsArray) {
        if (!"yes".equals(SystemProperties.get("ro.config.sync"))) {
            return;
        }        // - Get a cursor (A) over all sync'd calendars over all accounts
        // - Get a cursor (B) over all subscribed feeds for calendar
        // - If an item is in A but not B then add a subscription
        // - If an item is in B but not A then remove the subscription        ContentResolver cr = getContext().getContentResolver();
        Cursor cursorA = null;
        Cursor cursorB = null;
        try {
            cursorA = Calendar.Calendars.query(cr, null /* projection */,
                    Calendar.Calendars.SYNC_EVENTS + "=1", CALENDAR_KEY_SORT_ORDER);
            int urlIndexA = cursorA.getColumnIndexOrThrow(Calendar.Calendars.URL);
            int accountNameIndexA = cursorA.getColumnIndexOrThrow(Calendar.Calendars._SYNC_ACCOUNT);
            int accountTypeIndexA =
                    cursorA.getColumnIndexOrThrow(Calendar.Calendars._SYNC_ACCOUNT_TYPE);
            cursorB = SubscribedFeeds.Feeds.query(cr, FEEDS_KEY_COLUMNS,
                    SubscribedFeeds.Feeds.AUTHORITY + "=?", new String[]{Calendar.AUTHORITY},
                    FEEDS_KEY_SORT_ORDER);
            int urlIndexB = cursorB.getColumnIndexOrThrow(SubscribedFeeds.Feeds.FEED);
            int accountNameIndexB =
                    cursorB.getColumnIndexOrThrow(SubscribedFeeds.Feeds._SYNC_ACCOUNT);
            int accountTypeIndexB =
                    cursorB.getColumnIndexOrThrow(SubscribedFeeds.Feeds._SYNC_ACCOUNT_TYPE);
            for (CursorJoiner.Result joinerResult :
                    new CursorJoiner(cursorA, CALENDAR_KEY_COLUMNS, cursorB, FEEDS_KEY_COLUMNS)) {
                switch (joinerResult) {
                    case LEFT:
                        SubscribedFeeds.addFeed(
                                cr,
                                cursorA.getString(urlIndexA),
                                new Account(cursorA.getString(accountNameIndexA),
                                        cursorA.getString(accountTypeIndexA)),
                                Calendar.AUTHORITY,
                                CalendarClient.SERVICE);
                        break;
                    case RIGHT:
                        SubscribedFeeds.deleteFeed(
                                cr,
                                cursorB.getString(urlIndexB),
                                new Account(cursorB.getString(accountNameIndexB),
                                        cursorB.getString(accountTypeIndexB)),
                                Calendar.AUTHORITY);
                        break;
                    case BOTH:
                        // do nothing, since the subscription already exists
                        break;
                }
            }
        } finally {
            // check for null in case an exception occurred before the cursors got created
            if (cursorA != null) cursorA.close();
            if (cursorB != null) cursorB.close();
        }
    }
cursor B 空指针  然后不知道如何跟踪下去了,求高手指点这种问题如何跟踪