List of usage examples for android.database MatrixCursor MatrixCursor
public MatrixCursor(String[] columnNames)
From source file:de.vanita5.twittnuker.provider.TwidereDataProvider.java
private Cursor getUnreadCountsCursor() { final MatrixCursor c = new MatrixCursor(TwidereDataStore.UnreadCounts.MATRIX_COLUMNS); return c; }
From source file:de.vanita5.twittnuker.provider.TwidereDataProvider.java
private Cursor getUnreadCountsCursor(final int position) { final MatrixCursor c = new MatrixCursor(TwidereDataStore.UnreadCounts.MATRIX_COLUMNS); final Context context = getContext(); final SupportTabSpec tab = CustomTabUtils.getAddedTabAt(context, position); if (tab == null) return c; final int count; if (TAB_TYPE_HOME_TIMELINE.equals(tab.type) || TAB_TYPE_STAGGERED_HOME_TIMELINE.equals(tab.type)) { final long account_id = tab.args != null ? tab.args.getLong(EXTRA_ACCOUNT_ID, -1) : -1; final long[] account_ids = account_id > 0 ? new long[] { account_id } : getActivatedAccountIds(context); count = getUnreadCount(mUnreadStatuses, account_ids); } else if (TAB_TYPE_MENTIONS_TIMELINE.equals(tab.type)) { final long account_id = tab.args != null ? tab.args.getLong(EXTRA_ACCOUNT_ID, -1) : -1; final long[] account_ids = account_id > 0 ? new long[] { account_id } : getActivatedAccountIds(context); count = getUnreadCount(mUnreadMentions, account_ids); } else if (TAB_TYPE_DIRECT_MESSAGES.equals(tab.type)) { final long account_id = tab.args != null ? tab.args.getLong(EXTRA_ACCOUNT_ID, -1) : -1; final long[] account_ids = account_id > 0 ? new long[] { account_id } : getActivatedAccountIds(context); count = getUnreadCount(mUnreadMessages, account_ids); } else {/*from w w w .j a v a 2s . c om*/ count = 0; } if (tab.type != null) { c.addRow(new Object[] { position, tab.type, count }); } return c; }
From source file:org.getlantern.firetweet.provider.FiretweetDataProvider.java
private Cursor getDNSCursor(final String host) { final MatrixCursor c = new MatrixCursor(FiretweetDataStore.DNS.MATRIX_COLUMNS); try {/*from w ww .j av a 2 s .c o m*/ final InetAddress[] addresses = mHostAddressResolver.resolve(host); for (InetAddress address : addresses) { c.addRow(new String[] { host, address.getHostAddress() }); } } catch (final IOException ignore) { Crashlytics.logException(ignore); if (Utils.isDebugBuild()) { Log.w(LOGTAG, ignore); } } return c; }
From source file:org.getlantern.firetweet.provider.FiretweetDataProvider.java
private Cursor getNotificationsCursor() { final MatrixCursor c = new MatrixCursor(FiretweetDataStore.Notifications.MATRIX_COLUMNS); return c; }
From source file:org.getlantern.firetweet.provider.FiretweetDataProvider.java
private Cursor getNotificationsCursor(final int id) { final MatrixCursor c = new MatrixCursor(FiretweetDataStore.Notifications.MATRIX_COLUMNS); return c;/*from www . ja v a 2 s. c o m*/ }
From source file:de.vanita5.twittnuker.provider.TwidereDataProvider.java
private Cursor getUnreadCountsCursorByType(final String type) { final MatrixCursor c = new MatrixCursor(TwidereDataStore.UnreadCounts.MATRIX_COLUMNS); final int count; if (TAB_TYPE_HOME_TIMELINE.equals(type) || TAB_TYPE_STAGGERED_HOME_TIMELINE.equals(type)) { count = mUnreadStatuses.size();/*from w ww . j a va2 s. c o m*/ } else if (TAB_TYPE_MENTIONS_TIMELINE.equals(type)) { count = mUnreadMentions.size(); } else if (TAB_TYPE_DIRECT_MESSAGES.equals(type)) { count = mUnreadMessages.size(); } else { count = 0; } if (type != null) { c.addRow(new Object[] { -1, type, count }); } return c; }
From source file:com.av.remusic.service.MediaService.java
private void updateCursor(final long trackId) { MusicInfo info = mPlaylistInfo.get(trackId); if (mPlaylistInfo.get(trackId) != null) { MatrixCursor cursor = new MatrixCursor(PROJECTION); cursor.addRow(new Object[] { info.songId, info.artist, info.albumName, info.musicName, info.data, info.albumData, info.albumId, info.artistId }); cursor.moveToFirst();//from www .j av a 2 s .c om mCursor = cursor; cursor.close(); } }
From source file:org.getlantern.firetweet.provider.FiretweetDataProvider.java
private Cursor getUnreadCountsCursor() { final MatrixCursor c = new MatrixCursor(FiretweetDataStore.UnreadCounts.MATRIX_COLUMNS); return c; }
From source file:org.getlantern.firetweet.provider.FiretweetDataProvider.java
private Cursor getUnreadCountsCursor(final int position) { final MatrixCursor c = new MatrixCursor(FiretweetDataStore.UnreadCounts.MATRIX_COLUMNS); return c;/*from www .j a va 2s .c om*/ }
From source file:org.getlantern.firetweet.provider.FiretweetDataProvider.java
private Cursor getUnreadCountsCursorByType(final String type) { final MatrixCursor c = new MatrixCursor(FiretweetDataStore.UnreadCounts.MATRIX_COLUMNS); return c;//from w ww. ja v a2s .c o m }