Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. public class LvAdapter extends BaseAdapter{
  2.  
  3. LayoutInflater mInflater;
  4. private Context context;
  5. public LvAdapter(Context c){
  6. mInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  7. context = c;
  8. }
  9.  
  10. @Override
  11. public int getCount() {
  12. return cGlobal.listOfWork.size();
  13. }
  14.  
  15. @Override
  16. public Object getItem(int arg0) {
  17. return arg0;
  18. }
  19.  
  20. @Override
  21. public long getItemId(int arg0) {
  22. return arg0;
  23. }
  24.  
  25. @Override
  26. public View getView(int position, View convertView, ViewGroup arg2) {
  27. final ViewHolder holder;
  28. convertView=null;
  29. if (convertView == null) {
  30. holder = new ViewHolder();
  31.  
  32. convertView = mInflater.inflate(R.layout.activity_produced_quantities_rows, null); // this is your cell
  33.  
  34. holder.quantity = (EditText) convertView.findViewById(R.id.txtQuantity);
  35. holder.quantity.setTag(position);
  36.  
  37. convertView.setTag(holder);
  38. }
  39. else {
  40. holder = (ViewHolder) convertView.getTag();
  41. }
  42. return convertView;
  43. }
  44. }
  45.  
  46. public class ViewHolder {
  47. EditText quantity;
  48. }
  49.  
  50. public void isEmpty(){
  51. boolean isAnyEmpty=true;
  52. for (int i=0;i<quantityCheckList.size();i++){
  53. View view = lvQuestion.getAdapter().getView(i, null, null);
  54. EditText quantity = (EditText) view.findViewById(R.id.txtQuantity);
  55. quantity.requestFocus();
  56. quantity.setError("asdasda");
  57. isAnyEmpty=false;
  58. break;
  59. }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement