List of usage examples for android.media.tv TvContract buildChannelsUriForInput
public static Uri buildChannelsUriForInput(@Nullable String inputId)
From source file:Main.java
public static int getChannelCount(ContentResolver resolver, String inputId) { Uri uri = TvContract.buildChannelsUriForInput(inputId); String[] projection = { TvContract.Channels._ID }; Cursor cursor = null;//from ww w . j av a2 s . c om try { cursor = resolver.query(uri, projection, null, null, null); if (cursor != null) { return cursor.getCount(); } } finally { if (cursor != null) { cursor.close(); } } return 0; }
From source file:com.github.mkjensen.dml.live.SetupFragment.java
private static void deleteExistingChannels(ContentResolver resolver, String inputId) { int deleted = resolver.delete(TvContract.buildChannelsUriForInput(inputId), null, // where null // selectionArgs );/*from ww w .j a v a2 s . c om*/ Log.d(TAG, "Deleted existing channels: " + deleted); }