Android Question Thread not working in Class

Blue.Sky

Active Member
Licensed User
Longtime User
Hi
I wrote class module that add many product panel to scrollview with thread
In activity i dont have any problem
But in class not working
Thread start successfully but not call subrotine with Thread.Run
 

walterf25

Expert
Licensed User
Longtime User
Hi
I wrote class module that add many product panel to scrollview with thread
In activity i dont have any problem
But in class not working
Thread start successfully but not call subrotine with Thread.Run
It should work, maybe posting your code, or the relevant code will help others help you!

Cheers,
Walter
 
Upvote 0

Blue.Sky

Active Member
Licensed User
Longtime User
It should work, maybe posting your code, or the relevant code will help others help you!

Cheers,
Walter
I attach class module.
This module load product item to scrollview panel
 

Attachments

  • ListProducts.bas
    5 KB · Views: 250
Upvote 0

walterf25

Expert
Licensed User
Longtime User
I attach class module.
This module load product item to scrollview panel
First off, i haven't looked at your code in detail, but the first thing i can see is here
B4X:
Private Sub LoadProduct(res As List)
thread1.RunOnGuiThread("AddPanel",Array As Object(res.Get(i),i))
you're passing a List object and then here:
B4X:
Private Sub AddPanel(Temp As Map,i As Int)
you're expecting a Map object, i don't think that would work!

I'll look at the code later on in detail when i have more time.

Cheers,
Walter
 
Upvote 0

Blue.Sky

Active Member
Licensed User
Longtime User
First off, i haven't looked at your code in detail, but the first thing i can see is here
B4X:
Private Sub LoadProduct(res As List)
thread1.RunOnGuiThread("AddPanel",Array As Object(res.Get(i),i))
you're passing a List object and then here:
B4X:
Private Sub AddPanel(Temp As Map,i As Int)
you're expecting a Map object, i don't think that would work!

I'll look at the code later on in detail when i have more time.

Cheers,
Walter
Thank you i test it
 
Upvote 0

Blue.Sky

Active Member
Licensed User
Longtime User
I remove argument from procedure and it working right
 
Upvote 0
Top