gpt4 book ai didi

android - 无法完成刷新条目的计划请求。客户端错误代码 : 3

转载 作者:行者123 更新时间:2023-12-01 03:11:09 25 4
gpt4 key购买 nike

我收到 Firebase UI 回收器 View 的异常错误。我还包含错误附件。这是一个 Firebase Recycler View 。我在哪里使用 firebase 回收器适配器。每当我去用户 Activity 时,它都会在 logcat 中出现异常错误。请帮忙。
这是我的代码:

private Toolbar mToolbar;
private RecyclerView mUsersList;

private DatabaseReference AllUsersRef;
private FirebaseAuth mAuth;
String currentUserID;
private Query query;

private FirebaseRecyclerOptions<Users> options;
private FirebaseRecyclerAdapter<Users, UsersViewHolder> adapter;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_users);


AllUsersRef = FirebaseDatabase.getInstance().getReference().child("users");

mToolbar = findViewById(R.id.users_app_bar);
setSupportActionBar(mToolbar);
getSupportActionBar().setTitle("All Users");
getSupportActionBar().setDisplayHomeAsUpEnabled(true);

mUsersList = findViewById(R.id.users_list);
mUsersList.setHasFixedSize(true);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
mUsersList.setLayoutManager(linearLayoutManager);

}

@Override
protected void onStart() {
super.onStart();

AllUsersRef.child("online").setValue(true);

options = new FirebaseRecyclerOptions.Builder<Users>().setQuery(AllUsersRef, Users.class).build();

adapter = new FirebaseRecyclerAdapter<Users, UsersViewHolder>(options) {
@Override
protected void onBindViewHolder(@NonNull UsersViewHolder holder, int position, @NonNull Users model) {

final String user_id = getRef(position).getKey();

holder.mName.setText(model.getName());
holder.mStatus.setText(model.getStatus());

Picasso.get().load(model.getImage()).into(holder.mImage);

holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent profileIntent = new Intent(UsersActivity.this, ProfileActivity.class);
profileIntent.putExtra("user_id", user_id);
startActivity(profileIntent);
}
});
}

@NonNull
@Override
public UsersViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {

View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.users_display_layout, viewGroup, false);

return new UsersViewHolder(view);
}
};

adapter.startListening();
mUsersList.setAdapter(adapter);
}


@Override
protected void onStop() {
super.onStop();

FirebaseUser currentUser = FirebaseAuth.getInstance().getCurrentUser();

if(currentUser != null) {

//AllUsersRef.child("online").setValue(false);
}

}
}

这是我的 LOGCat 错误:
08-30 18:16:01.581 2667-9189/com.google.android.googlequicksearchbox:search E/EntrySyncManager: Cannot determine account name: drop request
08-30 18:16:01.582 2667-9189/com.google.android.googlequicksearchbox:search E/NowController: Failed to access data from EntryProvider. ExecutionException.
java.util.concurrent.ExecutionException: com.google.android.apps.gsa.sidekick.main.h.n: Could not complete scheduled request to refresh entries. ClientErrorCode: 3
at com.google.common.util.concurrent.d.eA(SourceFile:85)
at com.google.common.util.concurrent.d.get(SourceFile:23)
at com.google.common.util.concurrent.l.get(SourceFile:2)
at com.google.android.apps.gsa.staticplugins.nowstream.b.a.be.caI(SourceFile:47)
at com.google.android.apps.gsa.staticplugins.nowstream.b.a.be.caH(SourceFile:176)
at com.google.android.apps.gsa.staticplugins.nowstream.b.a.bh.run(Unknown Source:2)
at com.google.android.apps.gsa.shared.util.concurrent.at.run(SourceFile:4)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.google.android.apps.gsa.shared.util.concurrent.b.g.run(Unknown Source:4)
at com.google.android.apps.gsa.shared.util.concurrent.b.aw.run(SourceFile:4)
at com.google.android.apps.gsa.shared.util.concurrent.b.aw.run(SourceFile:4)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
at com.google.android.apps.gsa.shared.util.concurrent.b.i.run(SourceFile:6)
Caused by: com.google.android.apps.gsa.sidekick.main.h.n: Could not complete scheduled request to refresh entries. ClientErrorCode: 3
at com.google.android.apps.gsa.staticplugins.nowstream.b.a.aq.az(Unknown Source:4)
at com.google.common.util.concurrent.q.ap(SourceFile:7)
at com.google.common.util.concurrent.p.run(SourceFile:32)
at com.google.common.util.concurrent.bt.execute(SourceFile:3)
at com.google.common.util.concurrent.d.b(SourceFile:275)
at com.google.common.util.concurrent.d.addListener(SourceFile:135)
at com.google.common.util.concurrent.p.b(SourceFile:3)
at com.google.android.apps.gsa.shared.util.concurrent.h.a(SourceFile:16)
at com.google.android.apps.gsa.shared.util.concurrent.h.a(SourceFile:13)
at com.google.android.apps.gsa.staticplugins.nowstream.b.a.be.caI(SourceFile:45)
at com.google.android.apps.gsa.staticplugins.nowstream.b.a.be.caH(SourceFile:176) 
at com.google.android.apps.gsa.staticplugins.nowstream.b.a.bh.run(Unknown Source:2) 
at com.google.android.apps.gsa.shared.util.concurrent.at.run(SourceFile:4) 
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458) 
at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458) 
at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
at com.google.android.apps.gsa.shared.util.concurrent.b.g.run(Unknown Source:4) 
at com.google.android.apps.gsa.shared.util.concurrent.b.aw.run(SourceFile:4) 
at com.google.android.apps.gsa.shared.util.concurrent.b.aw.run(SourceFile:4) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at java.lang.Thread.run(Thread.java:764) 
at com.google.android.apps.gsa.shared.util.concurrent.b.i.run(SourceFile:6)

enter image description here

最佳答案

嘿,我遇到了同样的问题,但我意识到真正的问题是 LogCat 上这个错误上方的几行。事实证明,我将持有人上的按钮文本设置为 int,这导致了问题,因为我需要使用经典的 String.valueOf()这解决了我的问题。

由于您的问题似乎与 Firebase 无关,因此问题可能出在 holder.mStatus.setText(model.getStatus()); 上。
行,如果碰巧你的 getStatus()方法返回一个 int。
就像我的情况一样,你应该尝试用 String.valueOf() 包围它。 .

希望这有帮助,祝你好运!

关于android - 无法完成刷新条目的计划请求。客户端错误代码 : 3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52097588/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com