Android Question Insert rows using Web service

Discussion in 'Android Questions' started by b4auser1, Jun 30, 2015.

  1. b4auser1

    b4auser1 Well-Known Member Licensed User

    I have to add several rows from sqlite table to hosted database via http request.
    How to imlement a loop to add row by row if a call to Web service via HTTPUtils2 is not blocking ?
    I tried to use special variable as a flag, to check when previous call finished (Reset variable in the Done event Sub). Unfortunately the approach doesn't work. Application hangs up and I see in the log message:
    "sending message to waiting queue of uninitialized activity (submitjob)"
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Don't try to block the main thread. It will not work.

    Is the order of requests important? If not just send all the jobs one after another.

    If the order is important then you need to create a List with all the jobs. Download the first job and then in JobDone remove the first item from the list and download the next job (which will be List.Get(0)).
     
  3. b4auser1

    b4auser1 Well-Known Member Licensed User

    Thank you.
     
Loading...