示例#1
0
  public static HashMap<String, Object> getAllBookmark(Context ctx) {

    keyList = new ArrayList<String>();
    HashMap<String, Object> mBookmarkListData = new HashMap<String, Object>();
    for (int j = 65; j <= 90; j++) {
      char c = (char) j;
      alphabet = Character.toString(c);
      Cursor cursor =
          ctx.getContentResolver()
              .query(
                  Uri.parse(
                      MoverContentProvider.CONTENT_URI
                          + "/"
                          + MoverContentProvider.PLAY_BOOKMARK_PATH),
                  null,
                  COLUMN_NAME_PLAY_NAME + " LIKE " + "'" + alphabet + "%" + "'",
                  null,
                  null);
      /// .query(MoverContentProvider.CONTENT_URI+"/"+MoverContentProvider.PLAY_PATH, null, null,
      // null, null);
      Log.v("in playdiao cursor", "" + cursor.getCount());
      if (cursor != null && cursor.getCount() > 0) {
        playsList = new ArrayList<PlaysBean>();
        setColumns(cursor);
        keyList.add(alphabet);
        for (int i = 0; i < cursor.getCount(); i++) {
          cursor.moveToPosition(i);
          PlaysBean plays = new PlaysBean();
          plays.setPlayID(cursor.getString(COLUMN_INDEX_PLAY_ID));
          plays.setPlayID(cursor.getString(COLUMN_INDEX_PLAY_ID1));
          plays.setPlayName(cursor.getString(COLUMN_INDEX_PLAY_NAME));
          plays.setPlayImage(cursor.getString(COLUMN_INDEX_PLAY_IMAGE));
          plays.setPlayUrl(cursor.getString(COLUMN_INDEX_PLAY_URL));

          plays.setPlayAuthors(cursor.getString(COLUMN_INDEX_PLAY_AUTHORS));

          plays.setPlayVersion(cursor.getString(COLUMN_INDEX_PLAY_VERSION));
          plays.setPlayVersionID(cursor.getString(COLUMN_INDEX_PLAY_VERSION_ID));
          plays.setScrollPosition(cursor.getString(COLUMN_INDEX_PLAY_SCROLL_POSITION));

          playsList.add(plays);
        }
        mBookmarkListData.put(alphabet, playsList);
      }
      cursor.close();
    }
    return mBookmarkListData;
  }
示例#2
0
  public static ArrayList<PlaysBean> getAllVersionBookmark(Context ctx) {

    ArrayList<PlaysBean> list = new ArrayList<PlaysBean>();

    Cursor cursor =
        ctx.getContentResolver()
            .query(
                Uri.parse(
                    MoverContentProvider.CONTENT_URI
                        + "/"
                        + MoverContentProvider.PLAY_ALLBOOKMARK_PATH),
                null,
                null,
                null,
                null);

    if (cursor != null && cursor.getCount() > 0) {

      setColumns(cursor);

      for (int i = 0; i < cursor.getCount(); i++) {
        cursor.moveToPosition(i);
        PlaysBean plays = new PlaysBean();
        plays.setPlayID(cursor.getString(COLUMN_INDEX_PLAY_ID));
        plays.setPlayID(cursor.getString(COLUMN_INDEX_PLAY_ID1));
        plays.setPlayName(cursor.getString(COLUMN_INDEX_PLAY_NAME));
        plays.setPlayImage(cursor.getString(COLUMN_INDEX_PLAY_IMAGE));
        plays.setPlayUrl(cursor.getString(COLUMN_INDEX_PLAY_URL));

        plays.setPlayAuthors(cursor.getString(COLUMN_INDEX_PLAY_AUTHORS));

        plays.setPlayVersion(cursor.getString(COLUMN_INDEX_PLAY_VERSION));
        plays.setPlayVersionID(cursor.getString(COLUMN_INDEX_PLAY_VERSION_ID));
        plays.setScrollPosition(cursor.getString(COLUMN_INDEX_PLAY_SCROLL_POSITION));

        list.add(plays);
      }
    }
    cursor.close();
    // }
    return list;
  }
示例#3
0
  public static ArrayList<PlaysBean> getBookmarkDetail(Context ctx, String VersionId) {

    ArrayList<PlaysBean> list = new ArrayList<PlaysBean>();

    Cursor cursor =
        ctx.getContentResolver()
            .query(
                Uri.parse(
                    MoverContentProvider.CONTENT_URI
                        + "/"
                        + MoverContentProvider.SET_BOOKMARK_PATH),
                null,
                VersionId,
                null,
                null);
    /// .query(MoverContentProvider.CONTENT_URI+"/"+MoverContentProvider.PLAY_PATH, null, null,
    // null, null);
    Log.v("in playdiao cursor", "" + cursor.getCount());
    if (cursor != null && cursor.getCount() > 0) {

      setColumns(cursor);

      for (int i = 0; i < cursor.getCount(); i++) {
        cursor.moveToPosition(i);
        PlaysBean plays = new PlaysBean();
        plays.setPlayID(cursor.getString(COLUMN_INDEX_PLAY_ID));
        plays.setPlayName(cursor.getString(COLUMN_INDEX_PLAY_NAME));
        plays.setPlayImage(cursor.getString(COLUMN_INDEX_PLAY_IMAGE));
        plays.setPlayUrl(cursor.getString(COLUMN_INDEX_PLAY_URL));

        plays.setPlayAuthors(cursor.getString(COLUMN_INDEX_PLAY_AUTHORS));
        plays.setPlayVersion(cursor.getString(COLUMN_INDEX_PLAY_VERSION));
        plays.setPlayVersionID(cursor.getString(COLUMN_INDEX_PLAY_VERSION_ID));

        list.add(plays);
      }
    }
    cursor.close();
    return list;
  }