Facebook
From Cobalt Pintail, 4 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 296
  1. class CustomAdapter2 extends BaseAdapter {
  2.     @Override
  3.     public int getCount() {
  4.         return lista.size();
  5.     }
  6.     @Override
  7.     public Object getItem(int i) {
  8.         return null;
  9.     }
  10.     @Override
  11.     public long getItemId(int i) {
  12.         return 0;
  13.     }
  14.     @Override
  15.     public View getView(int i, View view, ViewGroup viewGroup) {
  16.         view = getLayoutInflater().inflate(R.layout.rowkontakty,null);
  17.         TextView textImie = (TextView)view.findViewById(R.id.textcontactname);
  18.         TextView textNazwisko = (TextView)view.findViewById(R.id.textcontactlastname);
  19.         TextView textTelefon = (TextView)view.findViewById(R.id.textcontactphone);
  20.         textImie.setText(lista.get(i).Imie);
  21.         textNazwisko.setText(lista.get(i).Nazwisko);
  22.         textTelefon.setText(lista.get(i).Telefon);
  23.         if(lista.get(i).Avatar.length >= 1) {
  24.            Bitmap Avatar = BitmapFactory.decodeByteArray(lista.get(i).Avatar, 0, lista.get(i).Avatar.length);
  25.             ImageView imageview = (ImageView) view.findViewById(R.id.imageViewavatar);
  26.             imageview.setImageBitmap(Avatar);
  27.         }
  28.         final int ii = i;
  29.         view.setOnClickListener(new View.OnClickListener() {
  30.             @Override
  31.             public void onClick(View view) {
  32.                 view.setBackgroundResource(R.color.colorPrimaryDark);
  33.                 Intent intent = new Intent(kontaktylista2.this, KontaktyDisplay.class);
  34.                 intent.putExtra("id", lista.get(ii).id);
  35.                 startActivity(intent);
  36.                 finish();
  37.             }
  38.         });
  39.         return view;
  40.     }
  41. }

Replies to 123 rss

Title Name Language When
Re: 123 Gray Gibbon text 4 Years ago.