在我的应用程序中,我发送了一个齐射请求,该请求一个接一个地获取列表项,而不是一次全部获取。我想在获取数据时在recyclerview的末尾实现一个进度条。类'updateAdapter'更新了适配器,我正在考虑使进度条在recyclerview滚动侦听器中可见。但是我不知道如何在我的代码中执行此操作。
updateAdapter.java
//THIS CLASS UPDATES THE RECYCLER VIEW
public class updateAdapter{
private FetchWpApi fetch;
private int totalItemCount;
private int prevLastvisible=0;
private int fpage=1;
private Context context;
private RecyclerView recyclerView;
private ArrayList<sItem> list= new ArrayList<>();
private LinearLayoutManager manager;
private ProgressBar progressBar;
//CONSTRUCTOR FOR updateAdapter
public updateAdapter(RecyclerView recyclerView, final Context context, String url, LinearLayoutManager manager){
this.context=context;
this.recyclerView=recyclerView;
fetch=new FetchWpApi(url,context);
this.manager=manager;
}
public void fetchAndPut()
{
if(recyclerView.getAdapter()==null) {
fetch.fetchApiData(fpage, new FetchWpApi.Callback() {
@Override
public void onSuccess(sItem sitem) {
list.add(sitem);
if (list.size() == 1 …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 twitter 实现 OAuth 身份验证。要在本地测试,我需要添加回调 URL ( http://127.0.0.1/... ) ,但是当我输入本地主机 URL 时,它会显示“无效的网站 url” 。
文档callback-urls指出这应该是有效的。
(PS 我对 Google 做了同样的事情,其中接受了本地主机 URL( http://127.0.0.1/... ))
我从jquery发送GET请求:
http://127.0.0.1:8000/viewspecs/itemdetails?param1="+variable1+"¶m2="+ variable2
Run Code Online (Sandbox Code Playgroud)
django中此部分的urls.py文件类似于:
url(r'^viewspecs/itemdetails?param1=(?P<specs_search_item>[\w\+%_ ./-]+)¶m2=(?P<item_price>[0-9])$', views.specsView),
Run Code Online (Sandbox Code Playgroud)
当我访问该地址时,我得到一个页面而不是(404)错误.为什么?