本文介绍了SeTransactionSyncTask:检索帐户java.lang.IllegalStateException时出错:没有当前的即点即付帐户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Firebase开发一个Android应用程序.并正在制作一个帖子系统.因此,使用这些代码,我想单击Firebase RecyclerView中的每个项目.

I use the Firebase to develop an android app.and was making a post system. so with these codes, I want to click each items in the Firebase RecyclerView.

并且我将代码更改为制作可点击的商品.

and I have changed my codes to making a clickable items.

更改在下面.

之前,

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

final Query DBquery = FirebaseDatabase.getInstance().getReference().child("post").orderByChild("count");
FirebaseRecyclerAdapter<Post, PostViewHolder> firebaseRecyclerAdapter = new FirebaseRecyclerAdapter<Post, PostViewHolder>(
        Post.class,
        R.layout.post_row,
        PostViewHolder.class,
        DBquery
        mDatabase
) {
    @Override
    protected void populateViewHolder(PostViewHolder viewHolder, Post model, int position) {

        viewHolder.setTitle(model.getTitle());
        viewHolder.setDesc(model.getDesc());
        viewHolder.setImage(getApplicationContext(), model.getImage());
        viewHolder.setDate(model.getDate());
    }
};
mPostList.setAdapter(firebaseRecyclerAdapter);
}

public static class PostViewHolder extends RecyclerView.ViewHolder {

View mView;

public PostViewHolder(View itemView) {
    super(itemView);

    mView = itemView;
}

public void setTitle(String title){
    TextView post_title = mView.findViewById(R.id.post_title);
    post_title.setText(title);
}

public void setDesc(String desc){

    TextView post_desc = mView.findViewById(R.id.post_desc);
    post_desc.setText(desc);
}

public void setImage(Context ctx, String image){
    ImageView post_image = mView.findViewById(R.id.post_image);
    Picasso.get().load(image).into(post_image);
}

public void setDate(String date){

    TextView post_date = mView.findViewById(R.id.post_date);
    post_date.setText(date);
}
}

之后

@Overried

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

    final Query DBquery = FirebaseDatabase.getInstance().getReference().child("post").orderByChild("count");
    FirebaseRecyclerOptions<Post> options = new FirebaseRecyclerOptions.Builder<Post>()
            .setQuery(DBquery, Post.class)
            .build();

    final FirebaseRecyclerAdapter<Post, PostViewHolder> firebaseRecyclerAdapter = new FirebaseRecyclerAdapter<Post, PostViewHolder>(options) {

        @NonNull
        @Override
        public PostViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {

            View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.post_row, parent, false);
            return new PostViewHolder(view);
        }

        @Override
        public void onBindViewHolder(@NonNull PostViewHolder holder, int position, Post model) {
            super.onBindViewHolder(holder, position);

            holder.setTitle(model.getTitle());
            holder.setDesc(model.getDesc());
            holder.setImage(getApplication(), model.getImage());
            holder.setDate(model.getDate());

        }
    };
    mPostList.setAdapter(firebaseRecyclerAdapter);
}



public static class PostViewHolder extends RecyclerView.ViewHolder {

    View mView;

    public PostViewHolder(View itemView) {
        super(itemView);
        mView = itemView;
    }

    public void setTitle(String title){
        TextView post_title = mView.findViewById(R.id.post_title);
        post_title.setText(title);
    }

    public void setDesc(String desc){

        TextView post_desc = mView.findViewById(R.id.post_desc);
        post_desc.setText(desc);
    }

    public void setImage(Context ctx, String image){
        ImageView post_image = mView.findViewById(R.id.post_image);
        Picasso.get().load(image).into(post_image);
    }

    public void setDate(String date){

        TextView post_date = mView.findViewById(R.id.post_date);
        post_date.setText(date);
    }
}

但是我得到了这个错误.而且我对这个问题一无所知.

But I got this error. and I have no clue for this issues actually.

下面的构建错误

Program type already present: 
android.arch.lifecycle.LiveData$LifecycleBoundObserver
Message{kind=ERROR, text=Program type already present: 
android.arch.lifecycle.LiveData$LifecycleBoundObserver, sources=[Unknown 
source file], tool name=Optional.of(D8)}

下面的LogCat错误

LogCat Error below

06-01 23:45:06.261 1959-3666/? E/SeTransactionSyncTask: Error retrieving account
java.lang.IllegalStateException: No current tap-and-pay account
    at alty.b(:com.google.android.gms@12685026@12.6.85 (040700-197041431):3)
    at alty.a(:com.google.android.gms@12685026@12.6.85 (040700-197041431):1)
    at amnv.a(:com.google.android.gms@12685026@12.6.85 (040700-197041431):28)
    at com.google.android.gms.tapandpay.gcmtask.TapAndPayGcmTaskChimeraService.b(:com.google.android.gms@12685026@12.6.85 (040700-197041431):1)
    at com.google.android.gms.tapandpay.gcmtask.TapAndPayGcmTaskChimeraService.a(:com.google.android.gms@12685026@12.6.85 (040700-197041431):1)
    at com.google.android.gms.tapandpay.phenotype.PhenotypeCommitIntentOperation.onHandleIntent(:com.google.android.gms@12685026@12.6.85 (040700-197041431):47)
    at com.google.android.chimera.IntentOperation.onHandleIntent(:com.google.android.gms@12685026@12.6.85 (040700-197041431):2)
    at dbn.a(:com.google.android.gms@12685026@12.6.85 (040700-197041431):8)
    at nam.a(:com.google.android.gms@12685026@12.6.85 (040700-197041431):9)
    at dbs.run(:com.google.android.gms@12685026@12.6.85 (040700-197041431):10)
    at dbp.run(:com.google.android.gms@12685026@12.6.85 (040700-197041431):9)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:761)

推荐答案

我面临类似的问题.但是,当我打开logcat并选择选项(在logcat屏幕的右上角)仅显示选定的应用程序"时,未显示错误.对于我来说,错误似乎对应用程序没有影响,并且无论有无错误,应用程序都可以正常运行.我使用Google Sheets api来读取和写入应用程序中的数据,但是付款不是应用程序的一部分.

I face similar issue. But, when I open logcat and choose option (at right corner of the logcat screen) "Show only selected application", error didnot show. It seems that error, for me, have no influence on app, and app is working fine with or without thar error. I use google sheets api for read/write data in app, but paying is not part of aplication.

这篇关于SeTransactionSyncTask:检索帐户java.lang.IllegalStateException时出错:没有当前的即点即付帐户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 15:30