Anonymous
Anonymous
it causes crash
Valentin
Could i see the stack trace?
Anonymous
Could i see the stack trace?
idk what is stack trace but here the error log, i knew it will crash since the list is not yet populated
Valentin
Show your adapter pls
Valentin
getItemCount and list
Anonymous
Anonymous
Valentin
try Collections.Empty_List(don't remember), or = new ArrayList
Valentin
where do you use context?
zlo
Привет. Kotlin. Есть коллекция классов. Надо найти класс (первый который встретится) у которого значение определённого поля равно заданному. Как красивее )
Nikita
firstIsInstance
zlo
firstIsInstance
Сорвалось. Не дописал
Саша
как передать в поиск браузера текст с приложения?
Valentin
What is this for?
because you have uninitialized property
Евгений
Мне надо сделать rebase из мастера в мою ветку. Как это сделать в Android studio?
Anonymous
where do you use context?
Here it is inside the adapter
Valentin
you can do like that: parent.getContext
Valentin
and remove one parameter from your Adapter constructor
Valentin
And for the second, you should update you data form your callback (onDataChange). So, inside your Adapter class create update method, which calls notifyDataSetChange, like this(for example): fun updateData(newData: ArrayList<String>) { itemsExample = newData notifyDataSetChanged() } (it's kotlin, but if you have any questions - ask)
Anonymous
you can do like that: parent.getContext
I didnt knew this thanks i already removed the context paramater in constructor
Valentin
make your properties private
Anonymous
make your properties private
i think i am doing that take a look inside the filter method
Valentin
oh, how long haven't i worked with filter :D
Anonymous
Does it work?
the filter code works but the published results seems to be the problem i honestly cannot track what causes the adapter to display wrong data. I logged the filtered data going inside the mFilteredList and it seems to be accurate but after getting passed idk what happens.
Anonymous
Here is the filter
Mike
idk what is stack trace but here the error log, i knew it will crash since the list is not yet populated
So learn basic Java before jumping into Android and try googling error message before asking in a chat.
Valentin
жестоко как-то
Anonymous
So learn basic Java before jumping into Android and try googling error message before asking in a chat.
i understand the error here, i already told him it would cause me a crash if i'd place the adapter initialization before the firebase code
Mike
жестоко как-то
Жестоко спрашивать, что такое нпе, и 10 скриншотов высирать
Valentin
:D
Valentin
селф-лёрнинг, бывает
Valentin
Ему, по факту, надо просто обновлять его список через коллбек, а он создавал для этого несколько адаптеров, когда дата менялась
Valentin
Ну бывает же, че
Anonymous
After being filtered the new arraylist data is then saved again to mFilteredList preceeded with notifyDataSetChanged
Valentin
how do you get your unfiltered data?
Anonymous
firebase? using model? ArrayList<MyModel>?
Valentin
you have heroes list, and filteredList. the first - you have to get heroeslist. You have to create something like this: private void updateData(newData: ArrayList<String>) { itemsExample = newData; notifyDataSetChanged(); } and call it from onDataChange
Valentin
adapter.updateData(list)
Valentin
instead adapter creation
Valentin
in your adapter class, you must initialize your properties. like this: ArrayList<Example> list = Collections.EMPTY_LIST
Valentin
or you will get NullPointerException
Mike
in your adapter class, you must initialize your properties. like this: ArrayList<Example> list = Collections.EMPTY_LIST
You won't be able to assign EmptyList to ArrayList variable, its type must be List
Valentin
Кстати да, чет я забылся
Витя
Ребят, подскажите че делать. Я никогда не изучал Java, все что у меня есть в арсенале - это основы SQL, можно ли учить Java именно в процессе обучения Android разработке, или все таки сначала нужно изучить ее до какого-то уровня вне контекста Android Studio? Или как вообще, что, куда
Кирилл
Изучи сначала ждаву хотя бы до уровня чтобы ты мог читать чужой код. Чтобы не было как выше
Витя
Ну конечно, совершенно
Valentin
По книгам джавку учить можешь, неплохой вариант
Витя
Например по каким ты бы учил на моем месте?
Витя
У меня есть такое вот чудо
Valentin
Искал бы издания новые. Я учил по Шилдту, и "Head First". Ну, и конечно же, статей много чиал
Витя
Говорят годно
Valentin
Так и есть, только там сухо, как в справочнике
Valentin
Но сойдет
Valentin
После этой книги я перечитал Head First Java
Valentin
А потом медленно начал в андроид вкатываться, тоже через эту же серию книг
Николай
Всем привет. Задача такая. Есть активность на ней текст и в конце или перед началом текста должна быть кнопка "Просмотреть видео" или какое-либо View внешне похожее на квадрат с картинкой по клику на который воспроизводится потоковое видео. Видео будет подгружаться с сервера Какие для этого нужны технологии хоть примерно?
Anonymous
i already solved my problem thank you
Dmytro
Но VLC там могут быть проблемы из-за Live555 плагина, он не поддерживает старые устройства, надо это ресёрчить
Dmytro
И если будешь сам собирать VLC это обязательно надо делать из под линукса
Anonymous
hi
Anonymous
how can I make RecyclerView and adding adapter????
Кирилл
Кто-нибудь может мне пояснить почему гугл решил сделать установку слушателя изменения текста через add (addTextChangedListener) а не set? И нужно ли в таком случае удалять слушатель в onPause?
Кирилл
Так а почему в этом случае разрешили много слушателей, а в других ограничили только одним слушателем (set вместо add)
Кирилл
Почему бы везде тогда не сделать возможность множества слушателей?
awawa
Так а почему в этом случае разрешили много слушателей, а в других ограничили только одним слушателем (set вместо add)
Наверное, не посчитали нужным. Хз чё у них там в голове. Может подумали что в некоторых случаях он неуместен и повлечёт ошибки
Anonymous
Есть кто тут из Краснодара? пишите в ЛС, шоб не спамить тут