WiFi Direct无法在Samsung Devices上运行

时间:2016-05-20 10:40:03

标签: java android android-studio wifi sharing

我正在开发基于WiFi的文件共享项目。此项目适用于除Samsung Devices之外的所有设备。这是我的代码。

public class MainReceiver extends BroadcastReceiver {

    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);
        }
    }
}

0 个答案:

没有答案