什么/在哪里是WiFiDirectActivity [英] What/where is a WiFiDirectActivity

查看:112
本文介绍了什么/在哪里是WiFiDirectActivity的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正试图理解并实现使用Wi-Fi创建P2P连接。这是作为一个单独的类添加到我现有的活动。在示例代码中有一行如下:

I am attempting to understand and implement the (incomplete) code described in "Creating P2P Connections with Wi-Fi". This is to add as a separate class to my existing activity. There is a line in the example code as follows:

activity.setIsWifiP2pEnabled(true);

但不显示变量活动来自哪里。寻找使用setIsWifiP2pEnabled()的其他示例代码我看到宣布活动的人如下:

but does not show where the variable "activity" came from. Looking for other example code which employs setIsWifiP2pEnabled() I saw one which declared activity as follows:

private WiFiDirectActivity activity;

但如果我添加该行,我得到错误 WiFiDirectActivity无法解析为一种类型。 Eclipse没有任何导入要添加的建议。所以我被困住了。

but if I add that line I get the error WiFiDirectActivity cannot be resolved to a type. Eclipse has no suggestions for any imports to add. So I am stuck.

推荐答案

该文件是一个示例项目的一部分,而不是一个用于使用的库/ jar。如果您需要它来实现代码,请查看该项目

That file is part of an example project, not a library/jar for you to consume. If you need it for implementing your code, look into that project

请参阅:
https://android.googlesource.com/platform/development/+/master/samples /WiFiDirectDemo/src/com/example/android/wifidirect/WiFiDirectActivity.java

这篇关于什么/在哪里是WiFiDirectActivity的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆