¡@

Home 

2014/10/16 ¤W¤È 08:23:39

android Programming Glossary: selectedpos

How can I make my ArrayAdapter follow the ViewHolder pattern?

http://stackoverflow.com/questions/3832254/how-can-i-make-my-arrayadapter-follow-the-viewholder-pattern

used to keep selected position in ListView private int selectedPos 1 init value for not selected public QuoteAdapter Context context.. this.items items public void setSelectedPosition int pos selectedPos pos inform the view of this change notifyDataSetChanged @Override.. v.getTag change the row color based on selected state if selectedPos position v.setBackgroundResource R.drawable.stocks_selected_gradient..

Android how to use adapter for listView without extending listActivity

http://stackoverflow.com/questions/8267060/android-how-to-use-adapter-for-listview-without-extending-listactivity

used to keep selected position in ListView private int selectedPos 1 init value for not selected public SelectedAdapter Context.. objects public void setSelectedPosition int pos selectedPos pos inform the view of this change notifyDataSetChanged public.. public int getSelectedPosition return selectedPos @Override public View getView int position View convertView..

How can I make my ArrayAdapter follow the ViewHolder pattern?

http://stackoverflow.com/questions/3832254/how-can-i-make-my-arrayadapter-follow-the-viewholder-pattern

extends ArrayAdapter Quote private ArrayList Quote items used to keep selected position in ListView private int selectedPos 1 init value for not selected public QuoteAdapter Context context int textViewResourceId ArrayList Quote items super context.. ArrayList Quote items super context textViewResourceId items this.items items public void setSelectedPosition int pos selectedPos pos inform the view of this change notifyDataSetChanged @Override public View getView int position View convertView ViewGroup.. get the holder instance from the view holder ViewHolder v.getTag change the row color based on selected state if selectedPos position v.setBackgroundResource R.drawable.stocks_selected_gradient holder.nameText.setTextColor Color.WHITE holder.priceText.setTextColor..

Android how to use adapter for listView without extending listActivity

http://stackoverflow.com/questions/8267060/android-how-to-use-adapter-for-listview-without-extending-listactivity

public class SelectedAdapter extends ArrayAdapter used to keep selected position in ListView private int selectedPos 1 init value for not selected public SelectedAdapter Context context int textViewResourceId List objects super context.. textViewResourceId List objects super context textViewResourceId objects public void setSelectedPosition int pos selectedPos pos inform the view of this change notifyDataSetChanged public int getSelectedPosition return selectedPos @Override.. int pos selectedPos pos inform the view of this change notifyDataSetChanged public int getSelectedPosition return selectedPos @Override public View getView int position View convertView ViewGroup parent View v convertView only inflate the view..