Karthikeyan Karthik
Karthikeyan Karthik

Reputation: 114

Thread files download in android?

I have created a thread at runtime. Every thread get files from soap. I have multiple files download at a time. But thread more than 350 kb files not download. How to solve this problem? I am beginners in android.

Upvotes: 1

Views: 664

Answers (1)

Bhanu Sharma
Bhanu Sharma

Reputation: 5145

use **intent service** dear it will always running while your process is not completed 



public class MyIntentService extends IntentService {







    public MyIntentService() {
        super("com.example.androidintentservice.MyIntentService");
    }

    @Override
    public void onCreate() {
        // TODO Auto-generated method stub
        super.onCreate();

    }

    @Override
    protected void onHandleIntent(Intent intent) {

        try {
                          DO YOUR TASK HERE 



            }



        } catch (Exception e) {
            e.printStackTrace();

        }

        // return result
        Intent intentResponse = new Intent();
        intentResponse.setAction(ACTION_MyIntentService);
        intentResponse.addCategory(Intent.CATEGORY_DEFAULT);
        intentResponse.putExtra(EXTRA_KEY_OUT, extraOut);
        sendBroadcast(intentResponse);
    }



}

Upvotes: 1

Related Questions