Android Question How Stop Downloading on CustomListview?

Ertan

Active Member
Licensed User
Hello there,
I am using CustomListView.
I am printing pictures and a few articles in the CustomListView.
I print these contents by parsing the JSON data.

I have such a problem.
When I add the data sequentially with customlistview and its addition is not completed yet, if the user finishes the activity, the activity is automatically opened again and customlistview is loaded again.

I want to do that.

If the user does activity finish, I want to cancel the download process.

I am using translation. If not understood, I can shoot a video. I can add a sample project.

Thank you so much.
 

AnandGupta

Expert
Licensed User
Longtime User
I can add a sample project.
Better do that.

As a suggested solution :
  1. you can define a public variable lDownload = true;
  2. and make it false when activity finish
  3. and check this variable before next download.
Regards,

Anand
 
Upvote 0

Ertan

Active Member
Licensed User
Better do that.

As a suggested solution :
  1. you can define a public variable lDownload = true;
  2. and make it false when activity finish
  3. and check this variable before next download.
Regards,

Anand
I'll try it tomorrow when I go to the office. If I fail, I'll write it. Thank you.
 
Upvote 0

Ertan

Active Member
Licensed User
I put a 250 millisecond wait to show what happened.

Step 1- Immediately after the data is listed, exit with the Back button.
The activity will restart automatically.
Am I taking a missing step somewhere?
How can I prevent this? I do not have this problem on iOS.

Thank you.
 

Attachments

  • DataCustomListView.zip
    15.9 KB · Views: 193
Upvote 0

Ertan

Active Member
Licensed User
Stop wasting your time with activities and switch to B4XPages. Especially if you are building cross platform solutions.
Thank you. The project I experienced this event is a big project. That's why I don't think I can get through.
I will use B4XPages in my new projects.

If you insist on using activities then move the communication code to a service.
This solution came to mind, but I wanted to ask if there might be a solution to stop downloading.

Thank you.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…