I am creating panels programatically based on number of entries in a database table, e.g if the table has 10 entries, i create 10 panels. Now i want the panels to be draggable around the screen. I have tried the DraggableView class but i keep getting NullPointerException error. Below is my code, please assist
B4X:
Dim Cursor1 As Cursor=sql1.ExecQuery("SELECT foodname,imaged FROM tastes")
Dim ttrow As Int=Cursor1.RowCount
Dim dv(ttrow) As DraggableView
For i = 0 To Cursor1.RowCount - 1
Cursor1.Position = i
' Log("************************")
Dim pnl As Panel
pnl.Initialize("pnl2")
pnl.LoadLayout("panel1")
dv(i).Initialize(Activity, pnl)
Activity.AddView(pnl,lft,tp,Activity.Width/5,Activity.Width/5+20dip)
Next