package com.mjsheng.myappstore.Thread;

import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class BroadcastThread extends Thread {
    String packagename[];
    String action;
    Context mcontext;

    public BroadcastThread(Context context, String a, String s[]) {
        super();
        this.mcontext = context;
        this.packagename = s;
        this.action = a;
    }

    @Override
    public void run() {
        super.run();
        for (String name : packagename) {
            Intent disIntent = new Intent(action);
            disIntent.putExtra("package_name", name);
            Log.e("mymjsheng", "package_name::" + name);
            mcontext.sendBroadcast(disIntent);
            try {
                sleep(3000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }

}
