我正在尝试从Firebase数据库检索数据并将其显示在Recycler视图中.App从数据库检索数据并在Recyclerview中显示 该应用程序运行良好,没有错误,但活动为空 在回收者视图中没有显示任何数据
错误:恢复到原来的dex文件用完
logcat消息
12-01 00:48:17.675 20068-20068/com.smartinfo.techguy.smartinfodesk W/ActionBarDrawerToggle: DrawerToggle may not show up because NavigationIcon is not visible. You may need to call actionbar.setDisplayHomeAsUpEnabled(true);
12-01 00:48:17.680 20068-20482/com.smartinfo.techguy.smartinfodesk W/zygote64: Unsupported class loader
12-01 00:48:17.682 20068-20482/com.smartinfo.techguy.smartinfodesk W/zygote64: Skipping duplicate class check due to unsupported classloader
miui_dex2oat: OatFile: /data/user_de/0/com.google.android.gms/app_chimera/m/0000002a/oat/arm64/DynamiteLoader.odex Compiler-Filter = speed
12-01 00:48:17.684 20068-20482/com.smartinfo.techguy.smartinfodesk I/DynamiteModule: Considering local module com.google.android.gms.firebase_database:4 and remote module com.google.android.gms.firebase_database:6
Selected remote version of com.google.android.gms.firebase_database, version >= 6
12-01 00:48:17.693 20068-20089/com.smartinfo.techguy.smartinfodesk V/FA: Activity resumed, time: 1068272741
12-01 00:48:17.698 20068-20089/com.smartinfo.techguy.smartinfodesk D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=Academic, firebase_previous_id(_pi)=8271408059740876105, firebase_screen_class(_sc)=Contact, firebase_screen_id(_si)=8271408059740876106}]
12-01 00:48:17.716 20068-20482/com.smartinfo.techguy.smartinfodesk W/zygote64: Unsupported class loader
12-01 00:48:17.717 20068-20482/com.smartinfo.techguy.smartinfodesk W/zygote64: miui_dex2oat: oat file of /data/user_de/0/com.google.android.gms/app_chimera/m/0000002c/DynamiteModulesC.apk is not exists
12-01 00:48:17.773 20068-20482/com.smartinfo.techguy.smartinfodesk W/zygote64: miui_dex2oat: /data/user_de/0/com.google.android.gms/app_chimera/m/0000002c/DynamiteModulesC.apk: Fall back to running out of the original dex file.
12-01 00:48:17.820 20068-20073/com.smartinfo.techguy.smartinfodesk I/zygote64: Compiler allocated 4MB to compile void android.view.View.<init>(android.content.Context, android.util.AttributeSet, int, int)
12-01 00:48:17.935 20068-20073/com.smartinfo.techguy.smartinfodesk I/zygote64: Do full code cache collection, code=214KB, data=172KB
12-01 00:48:17.936 20068-20073/com.smartinfo.techguy.smartinfodesk I/zygote64: After code cache collection, code=186KB, data=120KB
12-01 00:48:22.737 20068-20089/com.smartinfo.techguy.smartinfodesk V/FA: Inactivity, disconnecting from the service
我的主班
DatabaseReference dref;
Bundle bundle;
RecyclerView Rview;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_contact);
//DATABASE INSTANCE INITILIZE
dref= FirebaseDatabase.getInstance().getReference().child("Contact");
dref.keepSynced(true);
/* Program Logic starts here the firestore with
The recyclerview
*/
Rview=(RecyclerView)findViewById(R.id.recycle);
Rview.setHasFixedSize(true);
Rview.setLayoutManager(new LinearLayoutManager(this));
}
@Override
protected void onStart() {
super.onStart();
FirebaseRecyclerAdapter<RecyclerInput,RecycleViewHolder>firebaseRecyclerAdapter=new FirebaseRecyclerAdapter
<RecyclerInput, RecycleViewHolder>
(RecyclerInput.class,R.layout.recycle_row,RecycleViewHolder.class,dref) {
@Override
protected void populateViewHolder(RecycleViewHolder viewHolder, RecyclerInput model, int position)
{
viewHolder.setName(model.getName());
viewHolder.setPaper(model.getPaper());
viewHolder.setNumber(model.getNumber());
}
};
Rview.setAdapter(firebaseRecyclerAdapter);
}
public static class RecycleViewHolder extends RecyclerView.ViewHolder
{
View mview;
public RecycleViewHolder(View itemView)
{
super(itemView);
mview=itemView;
}
public void setName(String name)
{
TextView Name=(TextView)mview.findViewById(R.id.contactName);
Name.setText(name);
}
public void setNumber(String number)
{
TextView Number=(TextView)mview.findViewById(R.id.contactNo);
Number.setText(number);
}
public void setPaper(String paper)
{
TextView Pname =(TextView)mview.findViewById(R.id.contactPaper);
Pname.setText(paper);
}
}
//Toggle button Clickable code
@Override
public boolean onOptionsItemSelected(MenuItem item)
{
if(mToggle.onOptionsItemSelected(item))
{
return true;
}
return super.onOptionsItemSelected(item);
}