0

I have a problem with IntentService and cannot find solution. I have an UploadService class that extends IntentService.

public class UploadService extends IntentService {

@Override
protected void onHandleIntent(Intent intent) {
    sendItems();
}

sendItems() - method used to send files to Parse. It modifies some files if needed (operates on external storage), then communication occurrs.

What are possible causes of UI freeze?

LukeJanyga
  • 1,115
  • 9
  • 16
  • 1
    whats in sendItems(); method? – Qadir Hussain May 25 '15 at 16:26
  • 2
    `onHandleIntent()` is already called on a background thread. Please **do not create yet another thread** here. Your problem with the main application thread lies elsewhere. Use Traceview and/or `StrictMode` to try to identify where you are doing too much work on the main application thread. – CommonsWare May 25 '15 at 16:29
  • May be any other part of code from thread is working on UI thread. – Jibran Khan May 25 '15 at 16:29
  • Had a similar issue and the problem was creating the new thread in the onHandleIntent. onHandleIntent runs on a separate thread so you can directly handle your network operations in it. http://stackoverflow.com/questions/28705584/array-adapter-and-listview-issues-after-launching-intent-service – freddieptf May 25 '15 at 17:38
  • @CommonsWare Yes, it's an overkill. sendItems() is a method that invokes file upload. It modifies some files if needed and then uploads them to Parse db. I will edit my question to match current problem: Does file modification conflict with UI thread? – LukeJanyga May 27 '15 at 13:51

0 Answers0