Reliably cancelling a ConnectionRequest upload

39 views
Skip to first unread message

cubiq1

unread,
Sep 29, 2014, 2:19:50 PM9/29/14
to codenameone...@googlegroups.com
Hi,

I'd like users to be able to cancel the current upload operation, however, calling the code below doesn't work and often the image upload continues until completed:

    // Set hardware back button to close connection
    dlg
.setBackCommand(new Command("Cancel") {
       
@Override
       
public void actionPerformed(ActionEvent evt) {
           
if (NetworkManager.getInstance() != null) {
               
NetworkManager.getInstance().killAndWait(r);
                dlg
.dispose();
           
}
       
}
   
});

Any idea how to prevent the upload from continuing when cancelled?

Many thanks

Shai Almog

unread,
Sep 29, 2014, 9:40:00 PM9/29/14
to codenameone...@googlegroups.com
Hi,
we have support for canceling downloads but cancelling uploads might not be as common. Please file an RFE on this.

cubiq1

unread,
Sep 30, 2014, 3:58:24 AM9/30/14
to codenameone...@googlegroups.com
Hi, RFE has been filed as Issue 1198. Thanks!
Reply all
Reply to author
Forward
0 new messages