1、移除部分haloapp的静态变量
2、整理hardcode tag 3、修复NPE
This commit is contained in:
@ -249,7 +249,7 @@ public class FileReceiverActivity extends BaseActivity implements OnReceiverCanc
|
||||
EventBus.getDefault().post(new EBDownloadStatus("download"));
|
||||
|
||||
mReceiverServer.close();
|
||||
// HaloApp.remove("FileInfo");
|
||||
// HaloApp.remove(KcSelectGameActivity.KEY_FILE_INFO);
|
||||
mFileInfos.clear();
|
||||
|
||||
HaloApp.put("sendData", sendData);
|
||||
@ -264,7 +264,7 @@ public class FileReceiverActivity extends BaseActivity implements OnReceiverCanc
|
||||
|
||||
isDestroy = false;
|
||||
|
||||
// mFileInfos = (List<FileInfo>) HaloApp.get("FileInfo", false);
|
||||
// mFileInfos = (List<FileInfo>) HaloApp.get(KcSelectGameActivity.KEY_FILE_INFO, false);
|
||||
|
||||
sendData = new ArrayList<>();
|
||||
|
||||
@ -321,9 +321,9 @@ public class FileReceiverActivity extends BaseActivity implements OnReceiverCanc
|
||||
*/
|
||||
private void initServer() {
|
||||
mReceiverServer = new ServerRunnable(Constant.DEFAULT_SERVER_PORT);
|
||||
HaloApp.MAIN_EXECUTOR.execute(mReceiverServer);
|
||||
HaloApp.getInstance().getMainExecutor().execute(mReceiverServer);
|
||||
|
||||
HaloApp.MAIN_EXECUTOR.execute(new Runnable() {
|
||||
HaloApp.getInstance().getMainExecutor().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
@ -371,7 +371,7 @@ public class FileReceiverActivity extends BaseActivity implements OnReceiverCanc
|
||||
}
|
||||
|
||||
private void sendMessageToSender(final String sendData) throws Exception {
|
||||
HaloApp.MAIN_EXECUTOR.execute(new Runnable() {
|
||||
HaloApp.getInstance().getMainExecutor().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
@ -394,12 +394,12 @@ public class FileReceiverActivity extends BaseActivity implements OnReceiverCanc
|
||||
* @param msg
|
||||
*/
|
||||
private void parseFileInfo(String msg) {
|
||||
// mFileInfos = (List<FileInfo>) HaloApp.get("FileInfo", false); // mFileInfos 数据异常 需要重新获取
|
||||
// mFileInfos = (List<FileInfo>) HaloApp.get(KcSelectGameActivity.KEY_FILE_INFO, false); // mFileInfos 数据异常 需要重新获取
|
||||
FileInfo fileInfo = FileInfo.toObject(msg);
|
||||
if (fileInfo != null && fileInfo.getFilePath() != null) {
|
||||
mFileInfos.add(fileInfo);
|
||||
Utils.log("FileReceiverActivity 添加一条数据::" + msg);
|
||||
// HaloApp.put("FileInfo", mFileInfos);
|
||||
// HaloApp.put(KcSelectGameActivity.KEY_FILE_INFO, mFileInfos);
|
||||
|
||||
}
|
||||
}
|
||||
@ -650,7 +650,7 @@ public class FileReceiverActivity extends BaseActivity implements OnReceiverCanc
|
||||
}
|
||||
});
|
||||
|
||||
HaloApp.MAIN_EXECUTOR.execute(mFileReceiver);
|
||||
HaloApp.getInstance().getMainExecutor().execute(mFileReceiver);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
Reference in New Issue
Block a user