Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Change you Activity like this</p> <p>public class MainActivity extends Activity { ImageView Add; ImageView Shadow; ProgressBar PB;</p> <pre><code>ListView listView; String[] valuesUp = { "Lorem ipsum dolor sit amet, consectetur adipiscing elit", "Sed non justo eros. Praesent a nisl dui" }; String[] valuesDown = { "Quisque ut ante eu arcu sagittis porta eu a dolor...", "In orci augue facilisis eget fermentum consequat ac..." }; int[] imgValues = {R.drawable.mobileapp_16, R.drawable.mobileapp_19}; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); listView = (ListView) findViewById(R.id.listView1); listView.setAdapter(new MyAdapter(this,valuesUp,valuesDown,imgValues)); } </code></pre> <p>Change the Adapter like this </p> <pre><code>public class MyAdapter extends BaseAdapter { private final Context context; private final String[] valuesUp; private final String[] valuesDown; private final int[] ImageValue; private TextView textViewUp; private TextView textViewDown; private ImageView image; public MyAdapter(Context context, String[] valuesUP, String[] valuesDown, int[] imageValue) { super(context, R.layout.rowlayout, valuesUP); this.context = context; this.valuesUp = valuesUP; this.valuesDown = valuesDown; this.ImageValue = imageValue; } @Override public View getView(int position, View convertView, ViewGroup parent) { LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); View rowView; rowView = inflater.inflate(R.layout.rowlayout, parent, false); textViewUp = (TextView) rowView.findViewById(R.id.row_text_view_up); textViewDown = (TextView) rowView.findViewById(R.id.row_text_view_down); image = (ImageView) rowView.findViewById(R.id.image); textViewUp.setText(valuesUp[position]); textViewDown.setText(valuesDown[position]); image.setImageDrawable(context.getResources().getDrawable(ImageValue[position])); return rowView; } @Override public int getCount() { // TODO Auto-generated method stub return valuesUp.length; } @Override public Object getItem(int arg0) { // TODO Auto-generated method stub return valuesUp[arg0]; } @Override public long getItemId(int position) { // TODO Auto-generated method stub return position; }} </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. 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