Logo video2dn
  • Сохранить видео с ютуба
  • Категории
    • Музыка
    • Кино и Анимация
    • Автомобили
    • Животные
    • Спорт
    • Путешествия
    • Игры
    • Люди и Блоги
    • Юмор
    • Развлечения
    • Новости и Политика
    • Howto и Стиль
    • Diy своими руками
    • Образование
    • Наука и Технологии
    • Некоммерческие Организации
  • О сайте

Скачать или смотреть Room + ViewModel + LiveData + RecyclerView (MVVM) Part 9 - EDIT NOTES ON ITEM CLICK - Android

  • Coding in Flow
  • 2018-10-14
  • 76906
Room + ViewModel + LiveData + RecyclerView (MVVM) Part 9 - EDIT NOTES ON ITEM CLICK  - Android
  • ok logo

Скачать Room + ViewModel + LiveData + RecyclerView (MVVM) Part 9 - EDIT NOTES ON ITEM CLICK - Android бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно Room + ViewModel + LiveData + RecyclerView (MVVM) Part 9 - EDIT NOTES ON ITEM CLICK - Android или посмотреть видео с ютуба в максимальном доступном качестве.

Для скачивания выберите вариант из формы ниже:

  • Информация по загрузке:

Cкачать музыку Room + ViewModel + LiveData + RecyclerView (MVVM) Part 9 - EDIT NOTES ON ITEM CLICK - Android бесплатно в формате MP3:

Если иконки загрузки не отобразились, ПОЖАЛУЙСТА, НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если у вас возникли трудности с загрузкой, пожалуйста, свяжитесь с нами по контактам, указанным в нижней части страницы.
Спасибо за использование сервиса video2dn.com

Описание к видео Room + ViewModel + LiveData + RecyclerView (MVVM) Part 9 - EDIT NOTES ON ITEM CLICK - Android

In part 9 of the Architecture Components tutorial, we will implement our update functionality. For this we first create an OnItemClickListener interface in our RecyclerView.Adapter, together with an onItemClick method, which we use to forward the clicked note to the listener that implements this interface. We catch the click on the itemView in our ViewHolder class, get it's position with getAdapterPosition and compare it to RecyclerView.NO_POSITION to make sure that it is still valid.
We can either let our MainActivity implement this OnItemClickListener interface, or use an anonymous inner class. By overriding onItemClick, we can then handle the RecyclerView click in our activity.
We forward the data of the clicked note as intent extras to the same activity that is also responsible for creating new note entries with startActivityForResult, but additionaly we also send the clicked note's unique ID, because Room needs the primary key to figure out which entry in the entity's table it is supposed to update.
In this activity we populate our EditText fields and NumberPicker with the values we sent over, so the user can modify them. When he clicks the save menu icon, we finish the activity, send all the data back to the MainActivity over the resultIntent, and update the note over our ViewModel in the onActivityResult callback of our MainActivity. As usual, all changes apply to our RecyclerView adapter immediately, because our MainActivity observes LiveData.


Watch the whole playlist:
   • Плейлист  

Example code for this part:
https://gist.github.com/codinginflow/...

____________________
💻 Find the BEST programming tutorials on TutHub:
https://tuthub.io

⭐ Get my MVVM Caching Course now:
https://codinginflow.com/caching

❗ Subscribe to the channel:
   / codinginflo.  .

📨 Subscribe to the Coding in Flow newsletter:
https://codinginflow.com/newsletter

❓ Join our free developer community:
  / discord  

📣 Follow Coding in Flow on other sites:
Facebook:   / codinginflow  
Instagram:   / codinginflow  
TikTok:   / codinginflow  
Twitter:   / codinginflow  
Github: https://github.com/codinginflow

💰 Business requests, sponsoring, etc.: [email protected]

Комментарии

Информация по комментариям в разработке

Похожие видео

  • О нас
  • Контакты
  • Отказ от ответственности - Disclaimer
  • Условия использования сайта - TOS
  • Политика конфиденциальности

video2dn Copyright © 2023 - 2025

Контакты для правообладателей [email protected]