Last active
August 29, 2015 14:04
-
-
Save target-trust/ba0f591f5d0b7665d2e7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
publicView getView(int itempos, View convertView, ViewGroup parent) { | |
//Check if the convertview is null, if it is null it probably means that this //is the first time the view has been displayed | |
if (convertView == null) | |
{ | |
convertView = View.inflate(context, R.layout.list_content_layout, null); | |
} | |
//If it is not null, you can just reuse it from the recycler | |
TextView txtcontent = (TextView) convertView.findViewById(R.id.textView1); | |
ImageView imgcontent = (ImageView) convertView.findViewById(R.id.imageView1); | |
Paintings paintingcontent = content[itempos]; | |
txtcontent.setText(paintingcontent.imagetitle); | |
imgcontent.setImageResource(paintingcontent.drawableresid); | |
// return the view for a single item in the listview | |
return convertView; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment