0

自分のポートフォリオにアンドロイドでブログアプリを作成しようとしていますが、問題が発生しています。私がアプリケーションを開くと、リサイクラビューには何も表示されませんが、私は戻るボタンを押してアプリケーションを開くとリサイクラビューを表示し、実際のデバイスでアプリケーションを実行するときに直面しているこの問題を2つのエミュレータで実行しようとしましたNexus 5ともう1つのPixel 2です。これらは正常に機能し、最初の試みでリサイクラビューを読み込みます。Recycler Firebaseデータベースで動作を再開したときの更新を表示します。android

これは、アクティビティのコードである: - これはリサイクルビューのコードである

package raghuveer.singh.bhardwaj.blogapp; 

import android.content.Intent; 
import android.support.annotation.NonNull; 
import android.support.design.widget.NavigationView; 
import android.support.v4.widget.DrawerLayout; 
import android.support.v7.app.ActionBarDrawerToggle; 
import android.support.v7.app.AppCompatActivity; 
import android.os.Bundle; 
import android.support.v7.widget.LinearLayoutManager; 
import android.support.v7.widget.RecyclerView; 
import android.support.v7.widget.Toolbar; 
import android.util.Log; 
import android.view.Menu; 
import android.view.MenuItem; 
import android.view.View; 
import android.widget.ProgressBar; 
import android.widget.Toast; 

import com.google.firebase.auth.FirebaseAuth; 
import com.google.firebase.auth.FirebaseUser; 
import com.google.firebase.database.DataSnapshot; 
import com.google.firebase.database.DatabaseError; 
import com.google.firebase.database.DatabaseReference; 
import com.google.firebase.database.FirebaseDatabase; 
import com.google.firebase.database.ValueEventListener; 
import com.squareup.picasso.Picasso; 

import java.util.ArrayList; 
import java.util.Iterator; 
import java.util.List; 

import raghuveer.singh.bhardwaj.blogapp.Adapters.HomePostAdapter; 
import raghuveer.singh.bhardwaj.blogapp.PostPackage.PostPOJO; 

public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener, HomePostAdapter.CustomItemClickListener { 
    public ArrayList<PostPOJO> mListOfPost = new ArrayList<>(); 
    public ArrayList<String> topics = new ArrayList<>(); 
    HomePostAdapter homePostAdapter; 
    private FirebaseAuth mAuth; 
    private Toolbar mToolbar; 
    private DrawerLayout mDrawer; 
    private NavigationView mNavView; 
    private RecyclerView mRecyclerView; 
    private ProgressBar mProgressBar; 

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

     mAuth = FirebaseAuth.getInstance(); 
     mProgressBar = (ProgressBar) findViewById(R.id.progressbar); 
     mToolbar = (Toolbar) findViewById(R.id.toolbar); 
     mNavView = (NavigationView) findViewById(R.id.nav_view); 
     mRecyclerView = (RecyclerView) findViewById(R.id.mRecyclerView); 
     setSupportActionBar(mToolbar); 
     mDrawer = (DrawerLayout) findViewById(R.id.drawer_layout); 
     ActionBarDrawerToggle drawerToggle = new ActionBarDrawerToggle(this, mDrawer, mToolbar, R.string.open, R.string.close); 
     mDrawer.setDrawerListener(drawerToggle); 

     drawerToggle.syncState(); 

     mNavView.setNavigationItemSelectedListener(this); 


     LinearLayoutManager linearLayoutManager = new LinearLayoutManager(MainActivity.this, LinearLayoutManager.VERTICAL, false); 
     homePostAdapter = new HomePostAdapter(mListOfPost, MainActivity.this, MainActivity.this); 

     mRecyclerView.setAdapter(homePostAdapter); 
     mRecyclerView.setLayoutManager(linearLayoutManager); 
     mRecyclerView.setHasFixedSize(true); 
    } 

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

     Toast.makeText(this, "START", Toast.LENGTH_SHORT).show(); 

     mListOfPost = new ArrayList<>(); 
     topics = new ArrayList<>(); 

     final FirebaseDatabase database = FirebaseDatabase.getInstance(); 
     DatabaseReference referenceTopic = database.getReference("Users").child(mAuth.getCurrentUser().getUid()).child("Topics"); 

     FirebaseUser currentUser = mAuth.getCurrentUser(); 
     if (currentUser != null) { 
      Toast.makeText(this, "Log inned with user " + currentUser.getEmail(), Toast.LENGTH_SHORT).show(); 


      referenceTopic.orderByKey().addListenerForSingleValueEvent(new ValueEventListener() { 
       @Override 
       public void onDataChange(DataSnapshot dataSnapshot) { 
        for (DataSnapshot dsp : dataSnapshot.getChildren()) { 
         topics.add(String.valueOf(dsp.getValue(String.class))); 
        } 
       } 

       @Override 
       public void onCancelled(DatabaseError databaseError) { 

       } 
      }); 
      DatabaseReference referencePost = database.getReference("Posts"); 

      referencePost.orderByKey().addListenerForSingleValueEvent(new ValueEventListener() { 
       @Override 
       public void onDataChange(DataSnapshot dataSnapshot) { 
        for (DataSnapshot dsp : dataSnapshot.getChildren()) { 
         Log.d(MainActivity.class.getSimpleName(), dsp.child("topic").getValue().toString()); 

         Iterator<String> iterator = topics.iterator(); 
         while (iterator.hasNext()) { 
          String str = iterator.next(); 
          if (dsp.child("topic").getValue().equals(str)) { 
           PostPOJO postPOJO = dsp.getValue(PostPOJO.class); 
           mListOfPost.add(postPOJO); 
          } 
         } 

         mProgressBar.setVisibility(View.INVISIBLE); 


         homePostAdapter.updateData(mListOfPost); 
         homePostAdapter.notifyDataSetChanged(); 
        } 
       } 

       @Override 
       public void onCancelled(DatabaseError databaseError) { 

       } 
      }); 
     } else { 
      Intent intent = new Intent(this, SignUp.class); 
      startActivity(intent); 
     } 
    } 

    @Override 
    public boolean onCreateOptionsMenu(Menu menu) { 
     getMenuInflater().inflate(R.menu.main, menu); 
     return true; 
    } 

    public void signOut() { 
     mAuth.signOut(); 
     Intent intent = new Intent(this, SignUp.class); 
     startActivity(intent); 
    } 

    @Override 
    public boolean onOptionsItemSelected(MenuItem item) { 
     switch (item.getItemId()) { 
      case R.id.sign_out: 
       signOut(); 
     } 
     return true; 
    } 

    @Override 
    public boolean onNavigationItemSelected(@NonNull MenuItem item) { 
     switch (item.getItemId()) { 
      case R.id.Profile: 
       Intent profileIntent = new Intent(this, Profile.class); 
       startActivity(profileIntent); 
       break; 

      case R.id.Topics: 
       Intent topicsIntent = new Intent(this, Topics.class); 
       startActivity(topicsIntent); 
       break; 
     } 
     return false; 
    } 

    public void startPostActivity(View view) { 
     Intent intent = new Intent(this, Post.class); 
     startActivity(intent); 
    } 

    @Override 
    public void onItemClick(int position) { 
     Intent intent = new Intent(this, Post.class); 
     Bundle bundle = new Bundle(); 
     bundle.putSerializable("POJO", homePostAdapter.mListOfPost.get(position)); 
     intent.putExtras(bundle); 
     startActivity(intent); 
    } 
} 

: -

package raghuveer.singh.bhardwaj.blogapp.Adapters; 

import android.content.Context; 
import android.support.v7.widget.RecyclerView; 
import android.view.LayoutInflater; 
import android.view.View; 
import android.view.ViewGroup; 
import android.widget.ImageView; 
import android.widget.TextView; 

import com.squareup.picasso.Picasso; 

import java.util.ArrayList; 
import java.util.Iterator; 
import java.util.List; 

import raghuveer.singh.bhardwaj.blogapp.PostPackage.PostPOJO; 
import raghuveer.singh.bhardwaj.blogapp.R; 

/** 
* Created by Lenovo on 03-12-2017. 
*/ 

public class HomePostAdapter extends RecyclerView.Adapter<HomePostAdapter.viewHolder> { 

    public ArrayList<PostPOJO> mListOfPost; 
    private Context context; 
    CustomItemClickListener listener; 

    public interface CustomItemClickListener { 
     public void onItemClick(int position); 
    } 


    public HomePostAdapter(ArrayList<PostPOJO> mListOfPost, Context context,CustomItemClickListener customItemClickListener) { 
     this.mListOfPost = mListOfPost; 
     this.context = context; 
     this.listener = customItemClickListener; 
    } 

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

     final View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.post_item,parent,false); 
     final viewHolder mViewHolder = new viewHolder(view); 




     return mViewHolder; 

    } 

    @Override 
    public void onBindViewHolder(viewHolder holder, int position) { 
     PostPOJO postPOJO = mListOfPost.get(position); 
     holder.titleTextView.setText(postPOJO.getTitle()); 
     holder.subTitleTextView.setText(postPOJO.getSub_title()); 

     Boolean wasImageSet=false; 

     Iterator<String> iterator = postPOJO.grouped_elements.iterator(); 
     while (iterator.hasNext()){ 
      String str = iterator.next(); 

      if(str.startsWith("URL::")){ 
       Picasso.with(context) 
         .load(str.substring(5)) 
         .into(holder.headerImage); 
       wasImageSet = true; 
       break; 
      } 
     } 

     if(wasImageSet==false){ 
      holder.headerImage.setImageDrawable(context.getResources().getDrawable(R.drawable.emptyimage)); 
     } 

     holder.bind(position); 
    } 

    public void updateData(ArrayList<PostPOJO> postPOJOS){ 
     this.mListOfPost = postPOJOS; 
    } 
    @Override 
    public int getItemCount() { 
     return mListOfPost.size(); 
    } 

    public class viewHolder extends RecyclerView.ViewHolder{ 
     private ImageView headerImage; 
     private TextView titleTextView; 
     private TextView subTitleTextView; 

     public viewHolder(final View itemView) { 
      super(itemView); 

      headerImage = (ImageView)itemView.findViewById(R.id.headerImage); 
      titleTextView = (TextView)itemView.findViewById(R.id.title); 
      subTitleTextView = (TextView)itemView.findViewById(R.id.sub_title); 
     } 

     public void bind(final int position){ 
      itemView.setOnClickListener(new View.OnClickListener() { 
       @Override 
       public void onClick(View v) { 
        listener.onItemClick(position); 
       } 
      }); 
     } 


    } 
} 

ログインエミュレータ上でされています---

12-03 16:39:26.864 12822-12822/? I/zygote: Not late-enabling -Xcheck:jni (already on) 
12-03 16:39:26.928 12822-12822/? W/zygote: Unexpected CPU variant for X86 using defaults: x86 
12-03 16:39:27.113 12822-12822/raghuveer.singh.bhardwaj.blogapp W/zygote: Skipping duplicate class check due to unrecognized classloader 
12-03 16:39:27.115 12822-12822/raghuveer.singh.bhardwaj.blogapp W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found. 
12-03 16:39:27.119 12822-12822/raghuveer.singh.bhardwaj.blogapp W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found. 
12-03 16:39:27.122 12822-12822/raghuveer.singh.bhardwaj.blogapp I/BiChannelGoogleApi: [FirebaseAuth: ] No Fallback module; NOT setting up for lazy initialization 
12-03 16:39:27.170 12822-12843/raghuveer.singh.bhardwaj.blogapp W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found. 
12-03 16:39:27.179 12822-12843/raghuveer.singh.bhardwaj.blogapp I/FirebaseAuth: [FirebaseAuth:] Loading module via FirebaseOptions. 
12-03 16:39:27.179 12822-12843/raghuveer.singh.bhardwaj.blogapp I/FirebaseAuth: [FirebaseAuth:] Preparing to create service connection to gms implementation 
12-03 16:39:27.207 12822-12822/raghuveer.singh.bhardwaj.blogapp D/FirebaseAuth: Notifying id token listeners about user (sLZMm3S1o8TESyFjjy11mYEdVTG3). 
12-03 16:39:27.245 12822-12822/raghuveer.singh.bhardwaj.blogapp D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization. 
12-03 16:39:27.258 12822-12822/raghuveer.singh.bhardwaj.blogapp V/FA: Cancelling job. JobID: -2093232798 
12-03 16:39:27.260 12822-12822/raghuveer.singh.bhardwaj.blogapp V/FA: Registered activity lifecycle callback 
12-03 16:39:27.261 12822-12822/raghuveer.singh.bhardwaj.blogapp I/FirebaseInitProvider: FirebaseApp initialization successful 
12-03 16:39:27.298 12822-12822/raghuveer.singh.bhardwaj.blogapp V/FA: onActivityCreated 
12-03 16:39:27.329 12822-12846/raghuveer.singh.bhardwaj.blogapp V/FA: Collection enabled 
12-03 16:39:27.330 12822-12846/raghuveer.singh.bhardwaj.blogapp V/FA: App package, google app id: raghuveer.singh.bhardwaj.blogapp, 1:967774314306:android:75a87ded59f6ecc8 
12-03 16:39:27.346 12822-12846/raghuveer.singh.bhardwaj.blogapp I/FA: App measurement is starting up, version: 11717 
12-03 16:39:27.346 12822-12846/raghuveer.singh.bhardwaj.blogapp I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE 
12-03 16:39:27.347 12822-12846/raghuveer.singh.bhardwaj.blogapp I/FA: To enable faster debug mode event logging run: 
                     adb shell setprop debug.firebase.analytics.app raghuveer.singh.bhardwaj.blogapp 
12-03 16:39:27.347 12822-12846/raghuveer.singh.bhardwaj.blogapp D/FA: Debug-level message logging enabled 
12-03 16:39:27.400 12822-12846/raghuveer.singh.bhardwaj.blogapp V/FA: Connecting to remote service 
12-03 16:39:27.493 12822-12846/raghuveer.singh.bhardwaj.blogapp V/FA: Connection attempt already in progress 
12-03 16:39:27.525 12822-12822/raghuveer.singh.bhardwaj.blogapp I/DynamiteModule: Considering local module com.google.android.gms.firebase_database:4 and remote module com.google.android.gms.firebase_database:6 
12-03 16:39:27.525 12822-12822/raghuveer.singh.bhardwaj.blogapp I/DynamiteModule: Selected remote version of com.google.android.gms.firebase_database, version >= 6 
12-03 16:39:27.571 12822-12822/raghuveer.singh.bhardwaj.blogapp W/zygote: Skipping duplicate class check due to unrecognized classloader 
12-03 16:39:27.639 12822-12846/raghuveer.singh.bhardwaj.blogapp V/FA: Connection attempt already in progress 
12-03 16:39:27.640 12822-12846/raghuveer.singh.bhardwaj.blogapp V/FA: Activity resumed, time: 17890383 
12-03 16:39:27.662 12822-12846/raghuveer.singh.bhardwaj.blogapp I/FA: Tag Manager is not found and thus will not be used 
12-03 16:39:27.665 12822-12846/raghuveer.singh.bhardwaj.blogapp D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=-3708820839437256875}] 
12-03 16:39:27.669 12822-12850/raghuveer.singh.bhardwaj.blogapp D/OpenGLRenderer: HWUI GL Pipeline 
12-03 16:39:27.674 12822-12849/raghuveer.singh.bhardwaj.blogapp D/NetworkSecurityConfig: No Network Security Config specified, using platform default 
12-03 16:39:27.687 12822-12822/raghuveer.singh.bhardwaj.blogapp D/FirebaseApp: Notifying auth state listeners. 
12-03 16:39:27.689 12822-12822/raghuveer.singh.bhardwaj.blogapp D/FirebaseApp: Notified 1 auth state listeners. 
12-03 16:39:27.757 12822-12850/raghuveer.singh.bhardwaj.blogapp I/OpenGLRenderer: Initialized EGL, version 1.4 
12-03 16:39:27.757 12822-12850/raghuveer.singh.bhardwaj.blogapp D/OpenGLRenderer: Swap behavior 1 
12-03 16:39:27.757 12822-12850/raghuveer.singh.bhardwaj.blogapp W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without... 
12-03 16:39:27.757 12822-12850/raghuveer.singh.bhardwaj.blogapp D/OpenGLRenderer: Swap behavior 0 
12-03 16:39:27.758 12822-12846/raghuveer.singh.bhardwaj.blogapp V/FA: Connection attempt already in progress 
12-03 16:39:27.780 12822-12850/raghuveer.singh.bhardwaj.blogapp D/EGL_emulation: eglCreateContext: 0xa6f84540: maj 3 min 0 rcv 3 
12-03 16:39:27.797 12822-12850/raghuveer.singh.bhardwaj.blogapp D/EGL_emulation: eglMakeCurrent: 0xa6f84540: ver 3 0 (tinfo 0xa6f833e0) 
12-03 16:39:27.799 12822-12850/raghuveer.singh.bhardwaj.blogapp E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf 
12-03 16:39:27.799 12822-12850/raghuveer.singh.bhardwaj.blogapp E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf 
12-03 16:39:27.799 12822-12850/raghuveer.singh.bhardwaj.blogapp E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008824 
12-03 16:39:27.799 12822-12850/raghuveer.singh.bhardwaj.blogapp E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008824 
12-03 16:39:28.009 12822-12850/raghuveer.singh.bhardwaj.blogapp D/EGL_emulation: eglMakeCurrent: 0xa6f84540: ver 3 0 (tinfo 0xa6f833e0) 
12-03 16:39:28.093 12822-12850/raghuveer.singh.bhardwaj.blogapp D/EGL_emulation: eglMakeCurrent: 0xa6f84540: ver 3 0 (tinfo 0xa6f833e0) 
12-03 16:39:28.138 12822-12850/raghuveer.singh.bhardwaj.blogapp D/EGL_emulation: eglMakeCurrent: 0xa6f84540: ver 3 0 (tinfo 0xa6f833e0) 
12-03 16:39:28.177 12822-12846/raghuveer.singh.bhardwaj.blogapp D/FA: Connected to remote service 
12-03 16:39:28.178 12822-12846/raghuveer.singh.bhardwaj.blogapp V/FA: Processing queued up service tasks: 4 
12-03 16:39:29.645 12822-12832/raghuveer.singh.bhardwaj.blogapp I/zygote: Do partial code cache collection, code=30KB, data=30KB 
12-03 16:39:29.645 12822-12832/raghuveer.singh.bhardwaj.blogapp I/zygote: After code cache collection, code=29KB, data=30KB 
12-03 16:39:29.645 12822-12832/raghuveer.singh.bhardwaj.blogapp I/zygote: Increasing code cache capacity to 128KB 
12-03 16:39:29.669 12822-12850/raghuveer.singh.bhardwaj.blogapp D/EGL_emulation: eglMakeCurrent: 0xa6f84540: ver 3 0 (tinfo 0xa6f833e0) 
12-03 16:39:30.871 12822-12822/raghuveer.singh.bhardwaj.blogapp D/MainActivity: Cooking 
12-03 16:39:30.883 12822-12822/raghuveer.singh.bhardwaj.blogapp D/MainActivity: Programming 
12-03 16:39:30.944 12822-12822/raghuveer.singh.bhardwaj.blogapp W/Settings: Setting airplane_mode_on has moved from android.provider.Settings.System to android.provider.Settings.Global, returning read-only value. 
12-03 16:39:31.061 12822-12832/raghuveer.singh.bhardwaj.blogapp I/zygote: Do partial code cache collection, code=34KB, data=54KB 
12-03 16:39:31.063 12822-12832/raghuveer.singh.bhardwaj.blogapp I/zygote: After code cache collection, code=34KB, data=54KB 
12-03 16:39:31.063 12822-12832/raghuveer.singh.bhardwaj.blogapp I/zygote: Increasing code cache capacity to 256KB 
12-03 16:39:31.063 12822-12832/raghuveer.singh.bhardwaj.blogapp I/zygote: JIT allocated 71KB for compiled code of void android.widget.TextView.<init>(android.content.Context, android.util.AttributeSet, int, int) 
12-03 16:39:31.063 12822-12832/raghuveer.singh.bhardwaj.blogapp I/zygote: Compiler allocated 4MB to compile void android.widget.TextView.<init>(android.content.Context, android.util.AttributeSet, int, int) 
12-03 16:39:33.629 12822-12846/raghuveer.singh.bhardwaj.blogapp V/FA: Inactivity, disconnecting from the service 

ログイン実際のモバイルでは: -

12-03 16:41:11.099 2211-2211/? I/art: Late-enabling -Xcheck:jni 
12-03 16:41:11.199 2211-2211/raghuveer.singh.bhardwaj.blogapp W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found. 
12-03 16:41:11.203 2211-2211/raghuveer.singh.bhardwaj.blogapp W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found. 
12-03 16:41:11.212 2211-2211/raghuveer.singh.bhardwaj.blogapp I/BiChannelGoogleApi: [FirebaseAuth: ] No Fallback module; NOT setting up for lazy initialization 
12-03 16:41:11.222 2211-2211/raghuveer.singh.bhardwaj.blogapp D/FirebaseAuth: Notifying id token listeners about user (sLZMm3S1o8TESyFjjy11mYEdVTG3). 
12-03 16:41:11.223 2211-2232/raghuveer.singh.bhardwaj.blogapp W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found. 
12-03 16:41:11.232 2211-2211/raghuveer.singh.bhardwaj.blogapp D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization. 
12-03 16:41:11.242 2211-2232/raghuveer.singh.bhardwaj.blogapp I/FirebaseAuth: [FirebaseAuth:] Loading module via FirebaseOptions. 
12-03 16:41:11.242 2211-2232/raghuveer.singh.bhardwaj.blogapp I/FirebaseAuth: [FirebaseAuth:] Preparing to create service connection to gms implementation 
12-03 16:41:11.260 2211-2211/raghuveer.singh.bhardwaj.blogapp V/FA: Registered activity lifecycle callback 
12-03 16:41:11.261 2211-2211/raghuveer.singh.bhardwaj.blogapp I/FirebaseInitProvider: FirebaseApp initialization successful 
12-03 16:41:11.283 2211-2235/raghuveer.singh.bhardwaj.blogapp V/FA: Collection enabled 
12-03 16:41:11.284 2211-2235/raghuveer.singh.bhardwaj.blogapp V/FA: App package, google app id: raghuveer.singh.bhardwaj.blogapp, 1:967774314306:android:75a87ded59f6ecc8 
12-03 16:41:11.285 2211-2235/raghuveer.singh.bhardwaj.blogapp I/FA: App measurement is starting up, version: 11717 
12-03 16:41:11.286 2211-2235/raghuveer.singh.bhardwaj.blogapp I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE 
12-03 16:41:11.286 2211-2235/raghuveer.singh.bhardwaj.blogapp I/FA: To enable faster debug mode event logging run: 
                     adb shell setprop debug.firebase.analytics.app raghuveer.singh.bhardwaj.blogapp 
12-03 16:41:11.286 2211-2235/raghuveer.singh.bhardwaj.blogapp D/FA: Debug-level message logging enabled 
12-03 16:41:11.299 2211-2211/raghuveer.singh.bhardwaj.blogapp W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable 
12-03 16:41:11.302 2211-2235/raghuveer.singh.bhardwaj.blogapp V/FA: Connecting to remote service 
12-03 16:41:11.309 2211-2211/raghuveer.singh.bhardwaj.blogapp V/FA: onActivityCreated 
12-03 16:41:11.309 2211-2235/raghuveer.singh.bhardwaj.blogapp V/FA: Connection attempt already in progress 
12-03 16:41:11.462 2211-2211/raghuveer.singh.bhardwaj.blogapp I/DynamiteModule: Considering local module com.google.android.gms.firebase_database:4 and remote module com.google.android.gms.firebase_database:6 
12-03 16:41:11.462 2211-2211/raghuveer.singh.bhardwaj.blogapp I/DynamiteModule: Selected remote version of com.google.android.gms.firebase_database, version >= 6 
12-03 16:41:11.476 2211-2211/raghuveer.singh.bhardwaj.blogapp W/ResourcesManager: Asset path '/system/framework/com.android.media.remotedisplay.jar' does not exist or contains no resources. 
12-03 16:41:11.476 2211-2211/raghuveer.singh.bhardwaj.blogapp W/ResourcesManager: Asset path '/system/framework/com.android.location.provider.jar' does not exist or contains no resources. 
12-03 16:41:11.526 2211-2235/raghuveer.singh.bhardwaj.blogapp V/FA: Connection attempt already in progress 
12-03 16:41:11.526 2211-2235/raghuveer.singh.bhardwaj.blogapp V/FA: Activity resumed, time: 11707769 
12-03 16:41:11.535 2211-2235/raghuveer.singh.bhardwaj.blogapp I/FA: Tag Manager is not found and thus will not be used 
12-03 16:41:11.543 2211-2211/raghuveer.singh.bhardwaj.blogapp I/ViewRootImpl: CPU Rendering VSync enable = true 
12-03 16:41:11.543 2211-2235/raghuveer.singh.bhardwaj.blogapp D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=-7835563879800379359}] 
12-03 16:41:11.546 2211-2241/raghuveer.singh.bhardwaj.blogapp D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true 
12-03 16:41:11.565 2211-2211/raghuveer.singh.bhardwaj.blogapp D/Atlas: Validating map... 
12-03 16:41:11.574 2211-2211/raghuveer.singh.bhardwaj.blogapp D/FirebaseApp: Notifying auth state listeners. 
12-03 16:41:11.574 2211-2211/raghuveer.singh.bhardwaj.blogapp D/FirebaseApp: Notified 1 auth state listeners. 
12-03 16:41:11.577 2211-2211/raghuveer.singh.bhardwaj.blogapp I/ViewRootImpl: CPU Rendering VSync enable = true 
12-03 16:41:11.633 2211-2235/raghuveer.singh.bhardwaj.blogapp V/FA: Connection attempt already in progress 
12-03 16:41:11.638 2211-2241/raghuveer.singh.bhardwaj.blogapp I/Adreno-EGL: <qeglDrvAPI_eglInitialize:379>: EGL 1.4 QUALCOMM build: Nondeterministic_AU_msm8909_LA.BR.1.2.5_RB2__release_AU (I9d3821c5ab) 
                      OpenGL ES Shader Compiler Version: E031.25.03.04 
                      Build Date: 02/24/16 Wed 
                      Local Branch: mybranch18408715 
                      Remote Branch: quic/LA.BR.1.2.5_rb2.32 
                      Local Patches: NONE 
                      Reconstruct Branch: NOTHING 
12-03 16:41:11.639 2211-2241/raghuveer.singh.bhardwaj.blogapp I/OpenGLRenderer: Initialized EGL, version 1.4 
12-03 16:41:11.652 2211-2241/raghuveer.singh.bhardwaj.blogapp D/OpenGLRenderer: Enabling debug mode 0 
12-03 16:41:11.945 2211-2235/raghuveer.singh.bhardwaj.blogapp D/FA: Connected to remote service 
12-03 16:41:11.945 2211-2235/raghuveer.singh.bhardwaj.blogapp V/FA: Processing queued up service tasks: 4 
12-03 16:41:13.556 2211-2211/raghuveer.singh.bhardwaj.blogapp I/ViewRootImpl: CPU Rendering VSync enable = true 
12-03 16:41:13.633 2211-2241/raghuveer.singh.bhardwaj.blogapp V/RenderScript: Application requested CPU execution 
12-03 16:41:13.640 2211-2241/raghuveer.singh.bhardwaj.blogapp V/RenderScript: 0xb7a6a9d8 Launching thread(s), CPUs 4 
12-03 16:41:14.419 2211-2211/raghuveer.singh.bhardwaj.blogapp D/MainActivity: Cooking 
12-03 16:41:14.421 2211-2211/raghuveer.singh.bhardwaj.blogapp D/MainActivity: Programming 
12-03 16:41:14.433 2211-2211/raghuveer.singh.bhardwaj.blogapp I/Timeline: Timeline: Activity_idle id: [email protected] time:11295907 
12-03 16:41:17.363 2211-2235/raghuveer.singh.bhardwaj.blogapp V/FA: Inactivity, disconnecting from the service 
+0

'mRecyclerView.setHasFixedSize(true);'行を削除してみます。 –

+0

私はそれが動作していないことを試みた –

答えて

0

onStartメソッドを削除し、コード全体をonCreateメソッドにコピーしてみてください。

OnStartはライフサイクル中に数回呼び出されますが、onCreateは1回作成されます。だから、それらのfirebaseコードをonCreateに入れたいと思うでしょう。

これは、オンボタンが再び呼び出されたときにボタンが押されていて、アプリケーションを再び開くために働いています。

+0

私は泣く、その今も動作しません。 –

+0

アプリをデバッグして、実際のモバイルでの時間をアプリが再開したときの動作をW /設定:airplane_mode_onの設定がandroid.provider.Settings.Systemからandroid.provider.Settings.Globalに移動し、読み取り専用に戻りました値。このメッセージ –

+0

前のアクティビティで現在のユーザがnullであるかどうかを確認し、このアクティビティにインテントを渡すことができます。要するに、このアクティビティでユーザーを確認するためにif部分を削除します。 @Raghuveer –

0

私は2つの工程を経て問題を解決した: -

1)IはOnCreate関数でrecyclerviewを更新するコードを移動します。

2)私はポストクエリーを実行しました。トピッククエリーのondatachangeでデータスナップショットのforループの後に、ポストクエリーとリサイクラービューの更新コードを貼り付けることで、トピックアレイリストを作成しました。

説明するのが混乱しています。

関連する問題