You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
my adapter is unlike the one you showed in your example , and i cant find a way to implement it = adapter code (just help me implement it with two buttons like yours)
forget the id's currently , i didnt identify the id's as you said too and help me with the xml too
public class ListViewAdapter extends BaseAdapter {
// Declare Variables
Context context;
LayoutInflater inflater;
ArrayList<HashMap<String, String>> data;
HashMap<String, String> resultp = new HashMap<String, String>();
public ListViewAdapter(Context context,
ArrayList<HashMap<String, String>> arraylist) {
this.context = context;
data = arraylist;
}
@Override
public int getCount() {
return data.size();
}
@Override
public Object getItem(int position) {
return null;
}
@Override
public long getItemId(int position) {
return 0;
}
public View getView(final int position, View convertView, ViewGroup parent) {
// Declare Variables
inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View v = inflater.inflate(R.layout.custom, parent, false);
// Get the position
resultp = data.get(position);
TextView t1 = (TextView) v.findViewById(R.id.title);
TextView t2 = (TextView) v.findViewById(R.id.artist);
TextView t3 = (TextView) v.findViewById(R.id.textView1);
TextView t4 = (TextView) v.findViewById(R.id.duration);
ImageView lblThumb = (ImageView) v.findViewById(R.id.thumbie);
t1.setText(resultp.get(MainActivity.TITLE));
t2.setText(resultp.get(MainActivity.BRAND));
t3.setText(resultp.get(MainActivity.USE));
t4.setText(resultp.get(MainActivity.COST) + "$");
String a = resultp.get(MainActivity.URL);
try {
//UrlImageViewHelper.setUrlDrawable(lblThumb, a, R.drawable.loader);
Picasso.with(context)
.load(a)
.placeholder(R.drawable.loader)
.into(lblThumb);
} catch (Exception e) {
Log.d("error", "lol");
}
return v;
}
my adapter is unlike the one you showed in your example , and i cant find a way to implement it = adapter code (just help me implement it with two buttons like yours)
forget the id's currently , i didnt identify the id's as you said too and help me with the xml too
public class ListViewAdapter extends BaseAdapter {
}
XML :-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/list_selector"
android:padding="5sp"
The text was updated successfully, but these errors were encountered: