我正在开发基于WiFi的文件共享项目。我面临的问题是三星设备没有收到文件。这是我的代码。
private static final String TAG = MainReceiver.class.getName();
public static final String ACTION_TRANSFER_DONE = "action_transfer_done";
private MainActivity mActivity;
public MainReceiver(){
super();
}
public MainReceiver(MainActivity activity){
super();
mActivity = activity;
}
@Override
public void onReceive(Context context, Intent intent)
{
if (intent.getAction().toString().equalsIgnoreCase("action_transfer_done"))
{
Log.d(TAG, "transfer done");
List<String> mFileNames = intent.getStringArrayListExtra(ServerService.FILES_NAME);
mActivity.transferDone(mFileNames);
}
}