Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>row.xml</p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="right" android:orientation="horizontal" &gt; &lt;TextView android:id="@+id/text" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="0.8" android:gravity="right" android:paddingRight="5dp" android:text="@string/app_name" /&gt; &lt;ImageView android:id="@+id/img" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/bullet" android:contentDescription="@string/app_name" /&gt; &lt;/LinearLayout&gt; </code></pre> <p>main.xml</p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" &gt; &lt;ListView android:id="@+id/mCustomList" android:layout_width="fill_parent" android:layout_height="wrap_content" android:divider="#666666" android:dividerHeight="0.05dp" android:scrollingCache="false" /&gt; &lt;/LinearLayout&gt; </code></pre> <p>CstListAdapter.java</p> <pre><code>public class CstListAdapter extends BaseAdapter { private Activity activity; private ArrayList&lt;CstItem&gt; postList = new ArrayList&lt;CstItem&gt;(); private static LayoutInflater inflater = null; private Context ctx; public CstListAdapter(Activity act, ArrayList&lt;CstItem&gt; d, Context ctx) { activity = act; postList = d; inflater = (LayoutInflater) activity .getSystemService(Context.LAYOUT_INFLATER_SERVICE); this.ctx = ctx; } @Override public int getCount() { return postList.size() &lt; count ? postList.size() : count; } @Override public Object getItem(int position) { return position; } @Override public long getItemId(int position) { return position; } public static class ViewHolder { public TextView text; public ImageView img; } @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder; View row = convertView; if (row == null) { row = inflater.inflate(R.layout.row, null); holder = new ViewHolder(); holder.text= (TextViewPlus) row.findViewById(R.id.text); holder.img= (TextViewPlus) row.findViewById(R.id.img); row.setTag(holder); } else holder = (ViewHolder) row.getTag(); CstItem item = postList.get(position); holder.text.setText(item.getTitle()); return row; } </code></pre> <p>CstItem.java</p> <pre><code>public class CstItem { private String title; private String thumbnail; private String url; private String description; private String pubDate; public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getThumbnail() { return thumbnail; } public void setThumbnail(String thumbnail) { this.thumbnail = thumbnail; } ... } </code></pre> <p>Main.java</p> <pre><code>public class Main extends Activity { private ListView mListView; private CstListAdapter cstListAdaptor; private ArrayList&lt;CstItem&gt; PostList = new ArrayList&lt;CstItem&gt;(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mListView = (ListView) findViewById(R.id.mCustomList); cstListAdaptor = new CstListAdapter(this, PostList, this); mListView.setAdapter(cstListAdaptor); PostList.clear(); refreshRss(); mListView.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) { CstItem cit = PostList.get(position); String cnt = cit.getDescription(); //... } }); } ... } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload