Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. @Override
  2. public View getView( final int position, View convertView, ViewGroup parent) {
  3. View view = super.getView(position, convertView, parent);
  4. ImageView imageView = view.findViewById(R.id.detailsimage);
  5. CardView cardView = view.findViewById(R.id.detailcardView);
  6. TextView textmo =view.findViewById(R.id.detailsmo);
  7. TextView texttu =view.findViewById(R.id.detailstu);
  8. TextView textwe =view.findViewById(R.id.detailswe);
  9. TextView textth =view.findViewById(R.id.detailsthu);
  10. TextView textfr =view.findViewById(R.id.detailsfri);
  11. TextView textsa =view.findViewById(R.id.detailssat);
  12. TextView textsu =view.findViewById(R.id.detailssun);
  13.  
  14. final databasehandler db = new databasehandler(context);
  15. cardView.setOnLongClickListener(new View.OnLongClickListener() {
  16. @Override
  17. public boolean onLongClick(View v) {
  18.  
  19. db.deleteTitle(position+1);
  20. Toast.makeText(context,Integer.toString(position),Toast.LENGTH_SHORT).show();
  21. notifyDataSetChanged();
  22.  
  23. return true;
  24. }
  25. });
  26.  
  27. imageView.setOnClickListener(new View.OnClickListener() {
  28. @Override
  29. public void onClick(View view) {
  30. HashMap<String, String> hashmap= arrayList.get(position);
  31. String string= hashmap.get("repeat");
  32. string = Objects.requireNonNull(string).trim();
  33.  
  34.  
  35. Toast.makeText(context,string,Toast.LENGTH_SHORT).show();
  36. }
  37. });
  38.  
  39. HashMap<String, String> hashmap= arrayList.get(position);
  40. String string= Objects.requireNonNull(hashmap.get("repeat")).trim();
  41. String[] separated = Objects.requireNonNull(string).split("");
  42.  
  43. }
  44. }}
  45.  
  46.  
  47.  
  48.  
  49. return view;
  50.  
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement