Dynamic Views | Programmatically add, remove and control view items |

  Рет қаралды 31,404

Code Vedanam

Code Vedanam

3 жыл бұрын

In this video we will learn how we can add views dynamically and set data. Also see how can we remove that views.
Blog link
codevedanam.blogspot.com/2021...
Music: Early Hours
Musician: @iksonmusic

Пікірлер: 50
@TUSHAR-mj1en
@TUSHAR-mj1en 3 жыл бұрын
very informative and useful video 🔥🔥🔥🔥
@CodeVedanam
@CodeVedanam 3 жыл бұрын
Thank you❤
@codetap1429
@codetap1429 Жыл бұрын
Thank you so much! This is what I'm looking for
@ryanren7273
@ryanren7273 Жыл бұрын
This helps a lot. Thank you!
@peterknut5688
@peterknut5688 6 ай бұрын
Thanks so much. That is absolute the coolest app i have seen in youtube. It is so cool.
@mrestrella4
@mrestrella4 Жыл бұрын
Uffff so Helpfull!!!!!!!!!!!! Thanks!!!!!!!!!
@akashshrivastava8422
@akashshrivastava8422 3 жыл бұрын
Great help !! Please upload more 🙏🙏🙏🙏
@CodeVedanam
@CodeVedanam 3 жыл бұрын
Thank you, I will
@mairon1801
@mairon1801 2 жыл бұрын
Este video es justo lo que buscaba Bueno, casi pero suficiente para hacer lo que tengo en mente
@mairon1801
@mairon1801 2 жыл бұрын
Confirmo si me sirvio y descubri unas cositas más gracias a esto
@resha4653
@resha4653 2 жыл бұрын
I don't know why . But my code did not work. I write same as you. But my app crashed when i clicked on ok in dialog
@CHEBOYKA
@CHEBOYKA 2 жыл бұрын
Hello, thank you so much for this great tutorial! I'm wondering, if I want to have a number on the left side (starting with 1 to n) that is increasing with every card that I add, how could I accomplish that?
@CodeVedanam
@CodeVedanam 2 жыл бұрын
Add a text view for the number in card layout and use position to assign text
@ekramulhasanshawon2128
@ekramulhasanshawon2128 Жыл бұрын
great job it's problem that remove all data in container when close the app plz help me for the solve
@harifidynomenjanahary963
@harifidynomenjanahary963 2 жыл бұрын
Great job! but why did you create the AlertDialog dialog object? thx
@CodeVedanam
@CodeVedanam 2 жыл бұрын
We have to show the dialog in on click event of the add button, so if we build the dialog in every on click event, that will be a bad idea right.
@sadenlav
@sadenlav 5 ай бұрын
How to insert item to database all items in list?
@fajrulalam5046
@fajrulalam5046 2 жыл бұрын
Hi, thank u so much this is very helpful. I wish you could do a tutorial where it retrieves and stores the data from and to a SQLite database
@CodeVedanam
@CodeVedanam 2 жыл бұрын
Thank you brother
@rayan6051
@rayan6051 2 жыл бұрын
thanks but How can I clean up edittext after the first addition item
@CodeVedanam
@CodeVedanam 2 жыл бұрын
Follow this kzfaq.info/get/bejne/grederhkuqmzgIU.html
@mplussofttechnologies2050
@mplussofttechnologies2050 Жыл бұрын
how to edit view
@antoninopampinella3048
@antoninopampinella3048 Жыл бұрын
Can I use constrain layout instead of relative layout?
@CodeVedanam
@CodeVedanam Жыл бұрын
Yes you can
@louisewilliams7050
@louisewilliams7050 2 жыл бұрын
Great video, How could I store what has been created using sharedprefs
@suzaankhan1803
@suzaankhan1803 11 ай бұрын
Same question
@rayan6051
@rayan6051 2 жыл бұрын
how to save these added views...on closing the app and opening again my added views are deleted ....
@CodeVedanam
@CodeVedanam 2 жыл бұрын
Follow this kzfaq.info/get/bejne/grederhkuqmzgIU.html
@NickProkhorenko
@NickProkhorenko Жыл бұрын
How i can delete ConstraintLayout.LinearLayout object?
@CodeVedanam
@CodeVedanam Жыл бұрын
Java provides automatic garbage collection. No need to delete a object.
@leventestancz4522
@leventestancz4522 2 жыл бұрын
Hi when can I send you message for help? I'm having trouble in my project
@CodeVedanam
@CodeVedanam 2 жыл бұрын
You can write a email to me bhavinprajapat821@gmail.com
@leventestancz4522
@leventestancz4522 2 жыл бұрын
@@CodeVedanam I sent you an email
@CodeVedanam
@CodeVedanam 2 жыл бұрын
I will look at that and come back to you soon
@boscowong8640
@boscowong8640 2 жыл бұрын
Hi, thank you for the tutorial! can I ask if there is a way to delete all views at once with a button?
@CodeVedanam
@CodeVedanam 2 жыл бұрын
There will be a method like removeAll(), instead of removeView()
@danielmwinzi9223
@danielmwinzi9223 2 жыл бұрын
Can we make those cards permanent on even when you restart your app
@CodeVedanam
@CodeVedanam 2 жыл бұрын
Yes for that you have to save the data then whenever you start the app just read the data and add all
@danielmwinzi9223
@danielmwinzi9223 2 жыл бұрын
@@CodeVedanam save it in a database or?
@CodeVedanam
@CodeVedanam 2 жыл бұрын
You can save in a live database or save in a SQLite database
@danielmwinzi9223
@danielmwinzi9223 2 жыл бұрын
Thank you
@KoaKBeatz
@KoaKBeatz Жыл бұрын
At the end you don't show any app emulator, that's bad
@techguru2554
@techguru2554 3 жыл бұрын
Do you know hindi
@CodeVedanam
@CodeVedanam 3 жыл бұрын
Yes
@techguru2554
@techguru2554 3 жыл бұрын
@@CodeVedanam then why you don't do voice over
@CodeVedanam
@CodeVedanam 3 жыл бұрын
When we do a voiceover then we will bind it with some specific region but my audience is global. That is the reason.
@techguru2554
@techguru2554 3 жыл бұрын
@@CodeVedanam oh
@antoninopampinella3048
@antoninopampinella3048 Жыл бұрын
it gives me this error during the run time when i click on the button to strart the activity where the scroll layout is E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.dietapp, PID: 21413 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.dietapp/com.example.dietapp.Peso}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.pm.ApplicationInfo android.content.Context.getApplicationInfo()' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3194) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7356) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.pm.ApplicationInfo android.content.Context.getApplicationInfo()' on a null object reference at android.content.ContextWrapper.getApplicationInfo(ContextWrapper.java:163) at android.view.ContextThemeWrapper.getTheme(ContextThemeWrapper.java:174) at android.content.Context.obtainStyledAttributes(Context.java:738) at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:922) at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:889) at androidx.appcompat.app.AppCompatDelegateImpl.findViewById(AppCompatDelegateImpl.java:691) at androidx.appcompat.app.AppCompatActivity.findViewById(AppCompatActivity.java:264) at com.example.dietapp.Peso.(Peso.java:22) at java.lang.Class.newInstance(Native Method) at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95) at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:45) at android.app.Instrumentation.newActivity(Instrumentation.java:1243) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3182) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7356) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
@antoninopampinella3048
@antoninopampinella3048 Жыл бұрын
is it maybe because i did it in a secondary activity?
Was ist im Eis versteckt? 🧊 Coole Winter-Gadgets von Amazon
00:37
SMOL German
Рет қаралды 33 МЛН
Survival skills: A great idea with duct tape #survival #lifehacks #camping
00:27
ИРИНА КАЙРАТОВНА - АЙДАХАР (БЕКА) [MV]
02:51
ГОСТ ENTERTAINMENT
Рет қаралды 11 МЛН
RecyclerView | Everything You Need to Know
25:07
Practical Coding
Рет қаралды 129 М.
RecyclerView Item Click | Best Practice Way
8:06
Practical Coding
Рет қаралды 92 М.
Swipe gestures in Recycler View | Android
18:47
Mafia Codes
Рет қаралды 61 М.
Expandable Recycler View | Android
12:28
Mafia Codes
Рет қаралды 45 М.
How to Send Notification in Android
14:15
Codes Easy
Рет қаралды 37 М.
Android List view with clickable button
17:15
Android Developer
Рет қаралды 126 М.
Best mobile of all time💥🗿 [Troll Face]
0:24
Special SHNTY 2.0
Рет қаралды 3 МЛН
ОБСЛУЖИЛИ САМЫЙ ГРЯЗНЫЙ ПК
1:00
VA-PC
Рет қаралды 588 М.
Спутниковый телефон #обзор #товары
0:35
Product show
Рет қаралды 2,1 МЛН
1$ vs 500$ ВИРТУАЛЬНАЯ РЕАЛЬНОСТЬ !
23:20
GoldenBurst
Рет қаралды 1,5 МЛН