Dynamic Views | Programmatically add, remove and control view items | #dynamic #views #android #java

Dynamic Views | Programmatically add, remove and control view items | #dynamic #views #android #java

Code Vedanam

3 года назад

31,597 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Hunsen Drake
Hunsen Drake - 01.11.2023 02:09

where is app:cardCornerRadius comes from?

Ответить
Antonino Pampinella
Antonino Pampinella - 15.03.2023 01:28

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.<init>(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)

Ответить
Antonino Pampinella
Antonino Pampinella - 14.03.2023 04:24

Can I use constrain layout instead of relative layout?

Ответить
María Luisa Estrella
María Luisa Estrella - 02.02.2023 18:06

Uffff so Helpfull!!!!!!!!!!!! Thanks!!!!!!!!!

Ответить
Nick Prokhorenko
Nick Prokhorenko - 20.12.2022 02:02

How i can delete ConstraintLayout.LinearLayout object?

Ответить
Ryan Ren
Ryan Ren - 05.12.2022 14:43

This helps a lot. Thank you!

Ответить
KOAK Beatz
KOAK Beatz - 25.11.2022 22:37

At the end you don't show any app emulator, that's bad

Ответить
Ekramul Hasan Shawon
Ekramul Hasan Shawon - 04.09.2022 16:59

great job
it's problem that remove all data in container when close the app plz help me for the solve

Ответить
Code Tập
Code Tập - 24.08.2022 04:47

Thank you so much! This is what I'm looking for

Ответить
Mplussoft Technologies
Mplussoft Technologies - 12.08.2022 15:51

how to edit view

Ответить
Bosco Wong
Bosco Wong - 02.07.2022 15:05

Hi, thank you for the tutorial! can I ask if there is a way to delete all views at once with a button?

Ответить
Louise Williams
Louise Williams - 08.05.2022 15:06

Great video, How could I store what has been created using sharedprefs

Ответить
Re Sha
Re Sha - 22.04.2022 15:15

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

Ответить
StrongWOLF
StrongWOLF - 05.04.2022 00:19

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?

Ответить
Mairon
Mairon - 30.03.2022 22:04

Este video es justo lo que buscaba
Bueno, casi pero suficiente para hacer lo que tengo en mente

Ответить
rayan
rayan - 06.03.2022 23:24

how to save these added views...on closing the app and opening again my added views are deleted ....

Ответить
rayan
rayan - 06.03.2022 23:17

thanks but How can I clean up edittext after the first addition item

Ответить
Fajrul Alam
Fajrul Alam - 13.01.2022 07:02

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

Ответить
Daniel Mwinzi
Daniel Mwinzi - 26.10.2021 13:02

Can we make those cards permanent on even when you restart your app

Ответить
Harifidy Nomenjanahary
Harifidy Nomenjanahary - 30.08.2021 16:55

Great job! but why did you create the AlertDialog dialog object? thx

Ответить