Move "receiver" and "address" into UpdateService.EXTRA_...
This commit is contained in:
parent
f6707490f8
commit
e7f76705c8
@ -48,6 +48,9 @@ public class UpdateService extends IntentService implements ProgressListener {
|
|||||||
public static final int STATUS_ERROR = 2;
|
public static final int STATUS_ERROR = 2;
|
||||||
public static final int STATUS_INFO = 3;
|
public static final int STATUS_INFO = 3;
|
||||||
|
|
||||||
|
public static final String EXTRA_RECEIVER = "receiver";
|
||||||
|
public static final String EXTRA_ADDRESS = "address";
|
||||||
|
|
||||||
private ResultReceiver receiver = null;
|
private ResultReceiver receiver = null;
|
||||||
|
|
||||||
public UpdateService() {
|
public UpdateService() {
|
||||||
@ -136,9 +139,10 @@ public class UpdateService extends IntentService implements ProgressListener {
|
|||||||
Intent intent = new Intent(context, UpdateService.class);
|
Intent intent = new Intent(context, UpdateService.class);
|
||||||
UpdateReceiver receiver = new UpdateReceiver(new Handler());
|
UpdateReceiver receiver = new UpdateReceiver(new Handler());
|
||||||
receiver.setContext(context).setDialog(dialog);
|
receiver.setContext(context).setDialog(dialog);
|
||||||
intent.putExtra("receiver", receiver);
|
intent.putExtra(EXTRA_RECEIVER, receiver);
|
||||||
if (!TextUtils.isEmpty(address))
|
if (!TextUtils.isEmpty(address)) {
|
||||||
intent.putExtra("address", address);
|
intent.putExtra(EXTRA_ADDRESS, address);
|
||||||
|
}
|
||||||
context.startService(intent);
|
context.startService(intent);
|
||||||
|
|
||||||
return receiver;
|
return receiver;
|
||||||
@ -242,8 +246,8 @@ public class UpdateService extends IntentService implements ProgressListener {
|
|||||||
@Override
|
@Override
|
||||||
protected void onHandleIntent(Intent intent) {
|
protected void onHandleIntent(Intent intent) {
|
||||||
|
|
||||||
receiver = intent.getParcelableExtra("receiver");
|
receiver = intent.getParcelableExtra(EXTRA_RECEIVER);
|
||||||
String address = intent.getStringExtra("address");
|
String address = intent.getStringExtra(EXTRA_ADDRESS);
|
||||||
|
|
||||||
long startTime = System.currentTimeMillis();
|
long startTime = System.currentTimeMillis();
|
||||||
String errmsg = "";
|
String errmsg = "";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user