예제 #1
0
    @Override
    public void onClick() {
      AwesomeBarTabs.OnUrlOpenListener listener = getUrlListener();
      if (listener == null) return;

      String url = mCursor.getString(mCursor.getColumnIndexOrThrow(URLColumns.URL));
      String title = mCursor.getString(mCursor.getColumnIndexOrThrow(URLColumns.TITLE));
      listener.onUrlOpen(url, title);
    }
예제 #2
0
  public boolean handleItemClick(int groupPosition, int childPosition) {
    HistoryListAdapter adapter = getCursorAdapter();
    if (adapter == null) return false;

    @SuppressWarnings("unchecked")
    Map<String, Object> historyItem =
        (Map<String, Object>) adapter.getChild(groupPosition, childPosition);

    String url = (String) historyItem.get(URLColumns.URL);
    String title = (String) historyItem.get(URLColumns.TITLE);
    AwesomeBarTabs.OnUrlOpenListener listener = getUrlListener();
    if (!TextUtils.isEmpty(url) && listener != null) listener.onUrlOpen(url, title);

    return true;
  }