小编A.R*_*.R.的帖子

是否有可能获得wifi热点范围内的客户端设备的mac地址?

我想获得Wifi热点范围内所有设备(打开wifi的设备)的列表.但是它可能连接也可能没有连接到热点.我通过使用这个库获取连接设备的列表,但我不确定是否可以获得未连接到wifi热点的设备,并且只是在其范围内.如果有人可以澄清它的可能性,那将是非常好的.谢谢.

android personal-hotspot hotspot

9
推荐指数
1
解决办法
2656
查看次数

在Recyclerview适配器上设置notifyDataSetChanged()

我正在为RecyclerView实现无休止的数据加载.当软件检测到将显示最后一个项目时,它会下载新项目并调用该loadMoreData()函数,但不会显示新数据集.

当我打电话时notifyDataSetChanged(),没有什么事情发生.

我只有一个刷新视图的解决方案是再次设置适配器,但问题是recyclerview返回到第一个位置然后再次recyclelerview从第一个位置向上滚动到最后一个位置.

RecyclerViewActivity.java

    RecyclerView rv;

    DatabaseHelpr databaseHelpr;

    RVAdapter adapter;

    LocationFinder locationfinder;

    Location currentLocation;

    ArrayList<ServiceModel> childList, list;

    private int MainService_ID, city_id;

    String url2;

    ActionBar actionBar;

    JSONArray items = null;

    Utility utility;

    Double lat, longi;

    LinearLayoutManager llm;

    int counter=0;

    ProgressBar progressBar;

    private static final String TAG_ITEMS = "items";

    private static final String TAG_LOCALITY = "Locality";

    private static final String TAG_BUSINESS_ID = "Business_Id";

    private static final String TAG_LONGITUDE = "Longitude";

    private static final String TAG_BUSINESS_NAME = "Business_Name";

    private …
Run Code Online (Sandbox Code Playgroud)

android notifydatasetchanged endlessscroll recycler-adapter android-recyclerview

8
推荐指数
1
解决办法
4万
查看次数

如何在可搜索的微调器中使用SearchView.OnQueryTextListener()?

我正在使用第三方库创建一个可搜索的微调器.我在我的应用程序中添加了库类(SearchableListDialog,SearchableSpinner).一切都工作正常,但仍然是我面临的一个问题,例如,在搜索视图小部件中,如果我搜索Abc,我没有将结果过滤为Abc但是当点击列表视图项时,结果显示项目为ABC.这就像位置是项目的更改,但列表没有显示可搜索的结果.我不知道我哪里错了.我多次修改代码但没有得到理想的结果.

在此输入图像描述

Searchable Spinner xml代码:

 <com.example.my.currencyconverterapp.activity.SearchableSpinner
                    android:id="@+id/spinner"
                    android:layout_below="@+id/rl_currency_converterted_data"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content" />  
Run Code Online (Sandbox Code Playgroud)

这是我的片段代码,我正在为可搜索的微调器设置适配器.

countriesCustomAdapterInr = new CountriesCustomAdapterInr(getActivity(), R.layout.custom_spinner_items, arrayList,res);
        spinner.setAdapter(countriesCustomAdapterInr);
        assert spinner != null;
        spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
            @Override
            public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
                Toast.makeText(getActivity(), ""+arrayList.get(i).getFull_name()+i, Toast.LENGTH_LONG).show();
            }

            @Override
            public void onNothingSelected(AdapterView<?> adapterView) {}
        });  
Run Code Online (Sandbox Code Playgroud)

这是第三方SearchableSpinner类:

public class SearchableSpinner extends android.support.v7.widget.AppCompatSpinner implements View.OnTouchListener,
        SearchableListDialog.SearchableItem {

    public static final int NO_ITEM_SELECTED = -1;
    private Context _context;
    private List _items;
    private SearchableListDialog _searchableListDialog;

    private boolean _isDirty;
    private ArrayAdapter _arrayAdapter; …
Run Code Online (Sandbox Code Playgroud)

android listview android-arrayadapter android-spinner searchview

7
推荐指数
2
解决办法
2194
查看次数

如何使用 javaScript 检索 Firebase 数据库中的嵌套子值?

这是我的 Fireabse 数据库结构。我想检索20170116不是硬编码值的键数据。这是动态键。我得到了一些键和值,例如:

这是我的功能:

function getData(prospectId) {
    database.ref('users/'+prospectId).once('value').then(function(snapshot) {
        var prospectId = snapshot.key ;
        console.log("prospectId : "+ prospectId); // output is : prospectId : 1104812

        snapshot.forEach(function(childSnapshot) {
            var businessUrl = childSnapshot.key;
            console.log("businessUrl : "+ businessUrl); // output is : businessUrl : http:\\www.abc.com
            var dates = Object.keys(childSnapshot.val());
            console.log("dates : "+ dates); //output is : dates : 20170116,20170117,20170119,20170121
            var singleDate = dates[0];
            console.log("singleDate : "+ singleDate); //output is : singleDate : 20170116
        });
    });
}  

getData(1104812);
Run Code Online (Sandbox Code Playgroud)

这是我的 Fireabse 数据库结构

那么如何获取20170116日期数据或快照呢?

javascript firebase firebase-realtime-database

3
推荐指数
1
解决办法
5984
查看次数

LinkedIn v1到v2 API迁移

根据LinkedIn的公告,我们需要迁移到API和OAuth 2.0的2.0版,因此根据发布文档,我的GET请求网址从

 https://api.linkedin.com/v1/people/~:(first-name,last-name,email-address,skills,educations,positions,location,phone-numbers)?requestToken?scope=rw_nus+r_fullprofile&format=json&oauth2_access_token= 
Run Code Online (Sandbox Code Playgroud)

https://api.linkedin.com/v2/me/~:(first-name,last-name,email-address,skills,educations,positions,location,phone-numbers)?requestToken?scope=rw_nus+r_fullprofile&format=json&oauth2_access_token= 
Run Code Online (Sandbox Code Playgroud)

我得到以下回应:

{
    "serviceErrorCode": 0,
    "message": "Resource me does not exist",
    "status": 404
}
Run Code Online (Sandbox Code Playgroud)

请帮帮我,我这边出了什么问题?需要进行哪些更改?

android linkedin access-token linkedin-api

2
推荐指数
1
解决办法
1832
查看次数

如何使用Google街景发布API将一个全景图连接到多个全景图?

我在python中使用photo.update请求进行panos(360全景图像)连接.我只能将一个全景连接到另一个全景,但我想将一个全景连接到多个全景.我没有取得成功的结果.

我使用Python发送了以下photoUpdate请求:

update_photo_url = 'https://streetviewpublish.googleapis.com/v1/photo/{}?key={}&updateMask=connections'.format("pano_1","AIzdesdfyxscvvvvvvvvvvvvvvv")

headers = {"Authorization": "Bearer {}".format("ya29.Glx6BO91jWbjzLQKYPvP16fhT-jyOEnIdnoRcZcU9uYCqzwH3Dkuf-qf_kzUc2ykYOyVTZCfaGjOEAScsJK7WgS4NE9gfS6bSobWDIMdfpfY7SPzRMmxi4kfTrmsRQ"), "Content-Length": "0", "Content-Type": "application/json"}

update_body = {
[
{
"photo": {
  "photoId": {
    "id": "pano_1"
  },
  "connections": {
    "target": {
      "id": "pano_2"
    },
    "target": {
      "id": "pano_3"
    }
  },
}
}
]
}
update_response = requests.put(update_photo_url,headers=headers,json=update_body)
update_response.text  
Run Code Online (Sandbox Code Playgroud)

错误:

{
    "error": {
        "code": 400,
        "message": "Invalid JSON payload received. Unknown name \"\": Root element must be a message.",
        "status": "INVALID_ARGUMENT",
        "details": [
            {
                "@type": "type.googleapis.com/google.rpc.BadRequest",
                "fieldViolations": [
                    {
                        "description": "Invalid JSON …
Run Code Online (Sandbox Code Playgroud)

python json google-street-view google-streetview-publish

1
推荐指数
1
解决办法
441
查看次数