我現在停留在一個點上,找不到任何解決方案。圖庫,sqlite android?
描述:我有具有表(信道表),其具有4列
uid channel_name cid(country id) rating
uid是唯一的信道ID的源碼數據庫。
我有星級,三個圖像,如果星是黃色然後信道有4或5個等級 如果星是半黃色然後信道等級爲2或3,如果星白色然後額定值1將被考慮。
我在android中顯示了這些來自圖庫小部件的三個圖像。 ant星形圖像下面的頻道名稱。根據頻道評級。
public View getView(int paramInt, View paramView, ViewGroup paramViewGroup) {
View view = null;
Cursor mCursor=db.dataChannelsName();
mCursor.moveToFirst();
String [] channels_name = new String[mCursor.getCount()];
for(int icount=0; icount<mCursor.getCount();icount++) {
channels_name[icount] = mCursor.getString(mCursor.getColumnIndex("name"));
mCursor.moveToNext();
}
if(paramView == null) {
LayoutInflater inflater = LayoutInflater.from(mContext);
view = inflater.inflate(R.layout.items1, null);
ImageView image1 = (ImageView) view.findViewById(R.id.image1);
TextView description = (TextView) view.findViewById(R.id.description);
image1.setImageResource(mImageIds[paramInt]);
description.setTextColor(0xffffffff);
description.setText(channels_name[paramInt]);
} else {
view = paramView;
}
return view;
問題1:
我將如何只顯示不同頻道名稱的所有通道這三種圖像。?
問題2:
它可以是可能在數據庫
同名通道我使用SQL查詢和光標用於檢索數據。
現在我的問題是,當用戶將從畫廊中選擇特定的頻道,然後有可能有多個同名的頻道。
我只想在用戶點擊畫廊中的頻道名稱時存儲uid?
編輯我剛剛解決了第二個問題,但我在問題1
任何幫助卡住,將不勝感激。
你是對的。每次都會調用getView方法。順便說一下,我取消了這個設計,並使用不同的應用程序設計,並感謝您的時間。 –