首次启动应用程序时,登录后图片开始闪烁。重新启动后,此问题已解决。是MainActivity.java
还是AndroidManifest.xml
中的错误?
Android Studio出现错误。始终仅显示一个ViewPointer
0。
感谢您的帮助!
这是我的MainActivity.java
public class MainActivity extends AppCompatActivity {
private Fragment selectedfragment = null;
private FirebaseUser firebaseUser;
private DatabaseReference reference;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
firebaseUser = FirebaseAuth.getInstance().getCurrentUser();
reference = FirebaseDatabase.getInstance().getReference("Users").child(firebaseUser.getUid());
BottomNavigationView bottom_navigation = findViewById(R.id.bottom_navigation);
bottom_navigation.setOnNavigationItemSelectedListener(navigationItemSelectedListener);
bottom_navigation.getMenu().findItem(R.id.home).setChecked(true);
Bundle intent = getIntent().getExtras();
if (intent != null) {
String publisher = intent.getString("publisherid");
SharedPreferences.Editor editor = getSharedPreferences("PREFS", MODE_PRIVATE).edit();
editor.putString("profileid", publisher);
editor.apply();
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container,
new ProfileFragment()).commit();
} else {
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container,
new HomeFragment()).commit();
}
ImageButton ClickImageButton = findViewById(R.id.btnLaunchCamera);
ImageButton ClickImageButton2 = findViewById(R.id.imageButton2);
ClickImageButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(MainActivity.this, PostActivity.class));
}
});
ClickImageButton2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(MainActivity.this, OptionsActivity.class));
}
});
SearchView searchView = (SearchView) findViewById(R.id.searchView_home);
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
return false;
}
@Override
public boolean onQueryTextChange(String newText) {
return false;
}
});
}
private final BottomNavigationView.OnNavigationItemSelectedListener navigationItemSelectedListener =
new BottomNavigationView.OnNavigationItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
switch (item.getItemId()) {
case R.id.chat_notification:
selectedfragment = new ChatNotificationFragment();
break;
case R.id.home:
selectedfragment = new HomeFragment();
break;
case R.id.profile:
SharedPreferences.Editor editor = getSharedPreferences("PREFS", MODE_PRIVATE).edit();
editor.putString("profileid", Objects.requireNonNull(FirebaseAuth.getInstance().getCurrentUser()).getUid());
editor.apply();
selectedfragment = new ProfileFragment();
break;
}
if (selectedfragment != null) {
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, selectedfragment).commit();
}
return true;
}
};
private void status(String status){
reference = FirebaseDatabase.getInstance().getReference("Users").child(firebaseUser.getUid());
HashMap<String, Object> hashMap = new HashMap<>();
hashMap.put("status", status);
reference.updateChildren(hashMap);
}
@Override
protected void onResume() {
super.onResume();
status("online");
}
@Override
protected void onPause() {
super.onPause();
status("offline");
}
}
还有LoginActivity.class
public class LoginActivity extends AppCompatActivity {
private EditText email;
private EditText password;
private FirebaseAuth auth;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
email = findViewById(R.id.email);
password = findViewById(R.id.password);
Button login = findViewById(R.id.login);
TextView txt_signup = findViewById(R.id.txt_signup);
auth = FirebaseAuth.getInstance();
txt_signup.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(LoginActivity.this, RegisterActivity.class));
}
});
login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
final ProgressDialog pd = new ProgressDialog(LoginActivity.this);
pd.setMessage("Please wait...");
pd.show();
String str_email = email.getText().toString();
String str_password = password.getText().toString();
if (TextUtils.isEmpty(str_email) || TextUtils.isEmpty(str_password)){
Toast.makeText(LoginActivity.this, "All fields are required!", Toast.LENGTH_SHORT).show();
} else {
auth.signInWithEmailAndPassword(str_email, str_password)
.addOnCompleteListener(LoginActivity.this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
DatabaseReference reference = FirebaseDatabase.getInstance().getReference().child("Users")
.child(Objects.requireNonNull(auth.getCurrentUser()).getUid());
reference.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
pd.dismiss();
Intent intent = new Intent(LoginActivity.this, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
finish();
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
pd.dismiss();
}
});
} else {
pd.dismiss();
Toast.makeText(LoginActivity.this, "Authentication failed.", Toast.LENGTH_SHORT).show();
}
}
});
}
}
});
}
}
这是我发现很重要的日志。
2019-05-21 18:29:22.997 28351-28351/com.bbinkconnect.bbinktattoo D/ViewRootImpl@bb9034b[LoginActivity]: MSG_RESIZED: frame=Rect(0, 0 - 1080, 2220) ci=Rect(0, 72 - 0, 0) vi=Rect(0, 72 - 0, 0) or=1
2019-05-21 18:29:39.044 28351-28351/com.bbinkconnect.bbinktattoo D/ViewRootImpl@bb9034b[LoginActivity]: ViewPostIme pointer 0
2019-05-21 18:29:39.122 28351-28351/com.bbinkconnect.bbinktattoo D/ViewRootImpl@bb9034b[LoginActivity]: ViewPostIme pointer 1
2019-05-21 18:29:39.136 28351-28351/com.bbinkconnect.bbinktattoo D/Dialog: mIsSamsungBasicInteraction = false
2019-05-21 18:29:39.137 28351-28351/com.bbinkconnect.bbinktattoo D/Dialog: mIsSamsungBasicInteraction = false, isMetaDataInActivity = false
2019-05-21 18:29:39.326 28351-28351/com.bbinkconnect.bbinktattoo D/ScrollView: initGoToTop
2019-05-21 18:29:39.362 28351-28351/com.bbinkconnect.bbinktattoo D/ScrollView: initGoToTop
2019-05-21 18:29:39.426 28351-28351/com.bbinkconnect.bbinktattoo D/InputTransport: Input channel constructed: fd=82
2019-05-21 18:29:39.427 28351-28351/com.bbinkconnect.bbinktattoo D/ViewRootImpl@1f3d2b6[LoginActivity]: setView = DecorView@dc85bb7[LoginActivity] TM=true MM=false
2019-05-21 18:29:39.431 28351-28351/com.bbinkconnect.bbinktattoo W/BiChannelGoogleApi: [FirebaseAuth: ] getGoogleApiForMethod() returned Gms: com.google.firebase.auth.api.internal.zzak@caff24
2019-05-21 18:29:39.474 28351-28351/com.bbinkconnect.bbinktattoo D/ViewRootImpl@1f3d2b6[LoginActivity]: dispatchAttachedToWindow
2019-05-21 18:29:39.510 28351-28351/com.bbinkconnect.bbinktattoo D/ViewRootImpl@1f3d2b6[LoginActivity]: Relayout returned: old=[0,72][1080,2220] new=[27,972][1053,1320] result=0x7 surface={valid=true 486703767552} changed=true
2019-05-21 18:29:39.515 28351-28798/com.bbinkconnect.bbinktattoo D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
2019-05-21 18:29:39.515 28351-28798/com.bbinkconnect.bbinktattoo D/OpenGLRenderer: eglCreateWindowSurface = 0x7150d8a680, 0x7151ce2010
2019-05-21 18:29:39.534 28351-28351/com.bbinkconnect.bbinktattoo D/ViewRootImpl@1f3d2b6[LoginActivity]: MSG_WINDOW_FOCUS_CHANGED 1 1
2019-05-21 18:29:39.602 28351-28351/com.bbinkconnect.bbinktattoo D/ViewRootImpl@1f3d2b6[LoginActivity]: MSG_RESIZED: frame=Rect(27, 972 - 1053, 1320) ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1
2019-05-21 18:29:39.630 28351-28351/com.bbinkconnect.bbinktattoo D/ViewRootImpl@bb9034b[LoginActivity]: MSG_WINDOW_FOCUS_CHANGED 0 1
2019-05-21 18:29:39.630 28351-28351/com.bbinkconnect.bbinktattoo D/InputMethodManager: prepareNavigationBarInfo() DecorView@3c97128[LoginActivity]
2019-05-21 18:29:39.631 28351-28351/com.bbinkconnect.bbinktattoo D/InputMethodManager: getNavigationBarColor() -855310
2019-05-21 18:29:40.140 28351-28367/com.bbinkconnect.bbinktattoo D/FirebaseAuth: Notifying id token listeners about user ( LrSnbTOnxtZZ8rZ4QqL99532pjd2 ).
2019-05-21 18:29:40.140 28351-28367/com.bbinkconnect.bbinktattoo D/FirebaseAuth: Notifying auth state listeners about user ( LrSnbTOnxtZZ8rZ4QqL99532pjd2 ).
2019-05-21 18:29:40.245 28351-29180/com.bbinkconnect.bbinktattoo D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2019-05-21 18:29:40.342 28351-29180/com.bbinkconnect.bbinktattoo D/TcpOptimizer: TcpOptimizer-ON
2019-05-21 18:29:41.849 28351-28798/com.bbinkconnect.bbinktattoo W/libEGL: EGLNativeWindowType 0x7151ce2010 disconnect failed
2019-05-21 18:29:41.849 28351-28798/com.bbinkconnect.bbinktattoo D/OpenGLRenderer: eglDestroySurface = 0x7150d8a680, 0x7151ce2000
2019-05-21 18:29:41.850 28351-28351/com.bbinkconnect.bbinktattoo D/ViewRootImpl@1f3d2b6[LoginActivity]: dispatchDetachedFromWindow
2019-05-21 18:29:41.852 28351-28351/com.bbinkconnect.bbinktattoo D/ViewRootImpl@1f3d2b6[LoginActivity]: Surface release. android.view.ViewRootImpl.doDie:7931 android.view.ViewRootImpl.die:7899 android.view.WindowManagerGlobal.removeViewLocked:497 android.view.WindowManagerGlobal.removeView:435 android.view.WindowManagerImpl.removeViewImmediate:124 android.app.Dialog.dismissDialog:518 android.app.Dialog.dismiss:501 com.bbinkconnect.bbinktattoo.LoginActivity$2$1$1.onDataChange:79
2019-05-21 18:29:41.891 28351-28351/com.bbinkconnect.bbinktattoo D/InputTransport: Input channel destroyed: fd=82
2019-05-21 18:29:41.929 28351-28351/com.bbinkconnect.bbinktattoo D/ViewRootImpl@bb9034b[LoginActivity]: MSG_WINDOW_FOCUS_CHANGED 0 1
2019-05-21 18:29:41.929 28351-28351/com.bbinkconnect.bbinktattoo D/InputMethodManager: prepareNavigationBarInfo() DecorView@3c97128[LoginActivity]
2019-05-21 18:29:41.930 28351-28351/com.bbinkconnect.bbinktattoo D/InputMethodManager: getNavigationBarColor() -855310
2019-05-21 18:29:41.935 28351-28351/com.bbinkconnect.bbinktattoo E/ViewRootImpl: sendUserActionEvent() returned.
2019-05-21 18:29:41.942 28351-28351/com.bbinkconnect.bbinktattoo D/ViewRootImpl@32cd7d9[StartActivity]: dispatchDetachedFromWindow
2019-05-21 18:29:41.943 28351-28351/com.bbinkconnect.bbinktattoo D/ViewRootImpl@32cd7d9[StartActivity]: Surface release. android.view.ViewRootImpl.doDie:7931 android.view.ViewRootImpl.die:7899 android.view.WindowManagerGlobal.removeViewLocked:497 android.view.WindowManagerGlobal.removeView:435 android.view.WindowManagerImpl.removeViewImmediate:124 android.app.ActivityThread.handleDestroyActivity:4722 android.app.servertransaction.DestroyActivityItem.execute:39 android.app.servertransaction.TransactionExecutor.executeLifecycleState:145
2019-05-21 18:29:41.946 28351-28351/com.bbinkconnect.bbinktattoo D/InputTransport: Input channel destroyed: fd=70
2019-05-21 18:29:41.953 28351-28746/com.bbinkconnect.bbinktattoo V/FA: Recording user engagement, ms: 26738
2019-05-21 18:29:41.963 28351-28351/com.bbinkconnect.bbinktattoo D/ViewRootImpl@bb9034b[LoginActivity]: MSG_WINDOW_FOCUS_CHANGED 0 0
2019-05-21 18:29:41.963 28351-28746/com.bbinkconnect.bbinktattoo V/FA: Connecting to remote service
2019-05-21 18:29:41.964 28351-28351/com.bbinkconnect.bbinktattoo W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@66cb77f
2019-05-21 18:29:41.988 28351-28351/com.bbinkconnect.bbinktattoo V/FA: onActivityCreated
2019-05-21 18:29:41.992 28351-28746/com.bbinkconnect.bbinktattoo V/FA: Activity paused, time: 163765850
2019-05-21 18:29:42.058 28351-28746/com.bbinkconnect.bbinktattoo D/FA: Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=26738, firebase_screen_class(_sc)=LoginActivity, firebase_screen_id(_si)=4754157434908249509}]
2019-05-21 18:29:42.123 28351-28746/com.bbinkconnect.bbinktattoo V/FA: Connection attempt already in progress
2019-05-21 18:29:42.616 28351-28351/com.bbinkconnect.bbinktattoo D/InputTransport: Input channel constructed: fd=79
2019-05-21 18:29:42.617 28351-28351/com.bbinkconnect.bbinktattoo D/ViewRootImpl@9fd8955[MainActivity]: setView = DecorView@d898f6a[MainActivity] TM=true MM=false
2019-05-21 18:29:42.672 28351-28746/com.bbinkconnect.bbinktattoo D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=LoginActivity, firebase_previous_id(_pi)=4754157434908249509, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=4754157434908249510}]
2019-05-21 18:29:42.745 28351-28746/com.bbinkconnect.bbinktattoo V/FA: Connection attempt already in progress
2019-05-21 18:29:42.746 28351-28746/com.bbinkconnect.bbinktattoo V/FA: Connection attempt already in progress
2019-05-21 18:29:42.754 28351-28746/com.bbinkconnect.bbinktattoo V/FA: Activity resumed, time: 163766485
2019-05-21 18:29:42.786 28351-28351/com.bbinkconnect.bbinktattoo D/ViewRootImpl@9fd8955[MainActivity]: dispatchAttachedToWindow
2019-05-21 18:29:42.870 28351-28351/com.bbinkconnect.bbinktattoo D/ViewRootImpl@9fd8955[MainActivity]: Relayout returned: old=[0,0][1080,2220] new=[0,0][1080,2220] result=0x7 surface={valid=true 486689333248} changed=true
2019-05-21 18:29:42.881 28351-28798/com.bbinkconnect.bbinktattoo D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
2019-05-21 18:29:42.881 28351-28798/com.bbinkconnect.bbinktattoo D/OpenGLRenderer: eglCreateWindowSurface = 0x7150af0e00, 0x7150f1e010
2019-05-21 18:29:42.963 28351-28798/com.bbinkconnect.bbinktattoo W/libEGL: EGLNativeWindowType 0x7150ddc010 disconnect failed
2019-05-21 18:29:42.963 28351-28798/com.bbinkconnect.bbinktattoo D/OpenGLRenderer: eglDestroySurface = 0x7150af0800, 0x7150ddc000
2019-05-21 18:29:42.979 28351-28351/com.bbinkconnect.bbinktattoo D/ViewRootImpl@bb9034b[LoginActivity]: Relayout returned: old=[0,0][1080,2220] new=[0,0][1080,2220] result=0x5 surface={valid=false 0} changed=true
2019-05-21 18:29:42.988 28351-28746/com.bbinkconnect.bbinktattoo V/FA: Screen exposed for less than 1000 ms. Event not sent. time: 402
2019-05-21 18:29:42.989 28351-28746/com.bbinkconnect.bbinktattoo V/FA: Connection attempt already in progress
2019-05-21 18:29:42.997 28351-28746/com.bbinkconnect.bbinktattoo V/FA: Activity paused, time: 163766886
2019-05-21 18:29:43.079 28351-28746/com.bbinkconnect.bbinktattoo D/FA: Connected to remote service
2019-05-21 18:29:43.079 28351-28351/com.bbinkconnect.bbinktattoo W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@88c147d
2019-05-21 18:29:43.087 28351-28746/com.bbinkconnect.bbinktattoo V/FA: Processing queued up service tasks: 5
2019-05-21 18:29:43.108 28351-28351/com.bbinkconnect.bbinktattoo V/FA: onActivityCreated
2019-05-21 18:29:43.230 28351-28359/com.bbinkconnect.bbinktattoo I/ect.bbinktatto: Compiler allocated 4MB to compile void android.widget.TextView.<init>(android.content.Context, android.util.AttributeSet, int, int)
2019-05-21 18:29:43.519 28351-28351/com.bbinkconnect.bbinktattoo D/InputTransport: Input channel constructed: fd=85
2019-05-21 18:29:43.520 28351-28351/com.bbinkconnect.bbinktattoo D/ViewRootImpl@2045607[MainActivity]: setView = DecorView@e78f334[MainActivity] TM=true MM=false
2019-05-21 18:29:43.538 28351-28351/com.bbinkconnect.bbinktattoo I/Choreographer: Skipped 31 frames! The application may be doing too much work on its main thread.
2019-05-21 18:29:43.565 28351-28746/com.bbinkconnect.bbinktattoo D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=MainActivity, firebase_previous_id(_pi)=4754157434908249510, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=4754157434908249511}]
2019-05-21 18:29:43.661 28351-28351/com.bbinkconnect.bbinktattoo D/ViewRootImpl@2045607[MainActivity]: dispatchAttachedToWindow
2019-05-21 18:29:43.683 28351-28746/com.bbinkconnect.bbinktattoo V/FA: Activity resumed, time: 163767391
2019-05-21 18:29:43.731 28351-28351/com.bbinkconnect.bbinktattoo D/ViewRootImpl@2045607[MainActivity]: Relayout returned: old=[0,0][1080,2220] new=[0,0][1080,2220] result=0x7 surface={valid=true 486702960640} changed=true
2019-05-21 18:29:43.744 28351-28798/com.bbinkconnect.bbinktattoo D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
2019-05-21 18:29:43.744 28351-28798/com.bbinkconnect.bbinktattoo D/OpenGLRenderer: eglCreateWindowSurface = 0x714aef7800, 0x7151c1d010
2019-05-21 18:29:43.860 28351-28351/com.bbinkconnect.bbinktattoo W/ClassMapper: No setter/field for views found on class com.bbinkconnect.bbinktattoo.model.Story
2019-05-21 18:29:43.863 28351-28351/com.bbinkconnect.bbinktattoo W/ClassMapper: No setter/field for views found on class com.bbinkconnect.bbinktattoo.model.Story
2019-05-21 18:29:43.898 28351-28746/com.bbinkconnect.bbinktattoo V/FA: Screen exposed for less than 1000 ms. Event not sent. time: 406
2019-05-21 18:29:43.924 28351-28746/com.bbinkconnect.bbinktattoo V/FA: Activity paused, time: 163767797
2019-05-21 18:29:44.020 28351-28798/com.bbinkconnect.bbinktattoo W/libEGL: EGLNativeWindowType 0x7150f1e010 disconnect failed
2019-05-21 18:29:44.020 28351-28798/com.bbinkconnect.bbinktattoo D/OpenGLRenderer: eglDestroySurface = 0x7150af0e00, 0x7150f1e000
2019-05-21 18:29:44.184 28351-28351/com.bbinkconnect.bbinktattoo W/Glide: Failed to find GeneratedAppGlideModule. You should include an annotationProcessor compile dependency on com.github.bumptech.glide:compiler in your application and a @GlideModule annotated AppGlideModule implementation or LibraryGlideModules will be silently ignored
2019-05-21 18:29:45.047 28351-28351/com.bbinkconnect.bbinktattoo D/ViewRootImpl@9fd8955[MainActivity]: Relayout returned: old=[0,0][1080,2220] new=[0,0][1080,2220] result=0x5 surface={valid=false 0} changed=true
2019-05-21 18:29:45.108 28351-28351/com.bbinkconnect.bbinktattoo W/ClassMapper: No setter/field for views found on class com.bbinkconnect.bbinktattoo.model.Story
2019-05-21 18:29:45.110 28351-28351/com.bbinkconnect.bbinktattoo W/ClassMapper: No setter/field for views found on class com.bbinkconnect.bbinktattoo.model.Story
2019-05-21 18:29:45.135 28351-28351/com.bbinkconnect.bbinktattoo W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@6a289c6
2019-05-21 18:29:45.152 28351-28351/com.bbinkconnect.bbinktattoo V/FA: onActivityCreated
2019-05-21 18:29:45.403 28351-28351/com.bbinkconnect.bbinktattoo D/InputTransport: Input channel constructed: fd=86
2019-05-21 18:29:45.404 28351-28351/com.bbinkconnect.bbinktattoo D/ViewRootImpl@dc47a7c[MainActivity]: setView = DecorView@1e21f05[MainActivity] TM=true MM=false
2019-05-21 18:29:45.406 28351-28351/com.bbinkconnect.bbinktattoo I/Choreographer: Skipped 88 frames! The application may be doing too much work on its main thread.
2019-05-21 18:29:45.456 28351-28746/com.bbinkconnect.bbinktattoo D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=MainActivity, firebase_previous_id(_pi)=4754157434908249511, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=4754157434908249512}]
2019-05-21 18:29:45.574 28351-28746/com.bbinkconnect.bbinktattoo V/FA: Activity resumed, time: 163769278
2019-05-21 18:29:46.050 28351-28351/com.bbinkconnect.bbinktattoo D/ViewRootImpl@dc47a7c[MainActivity]: dispatchAttachedToWindow
2019-05-21 18:29:46.083 28351-28351/com.bbinkconnect.bbinktattoo D/ViewRootImpl@dc47a7c[MainActivity]: Relayout returned: old=[0,0][1080,2220] new=[0,0][1080,2220] result=0x1 surface={valid=false 0} changed=false
2019-05-21 18:29:46.105 28351-28351/com.bbinkconnect.bbinktattoo E/ViewRootImpl@dc47a7c[MainActivity]: Surface is not valid.
2019-05-21 18:29:46.123 28351-28351/com.bbinkconnect.bbinktattoo W/ClassMapper: No setter/field for views found on class com.bbinkconnect.bbinktattoo.model.Story
2019-05-21 18:29:46.126 28351-28351/com.bbinkconnect.bbinktattoo I/chatty: uid=10415(com.bbinkconnect.bbinktattoo) identical 2 lines
2019-05-21 18:29:46.127 28351-28351/com.bbinkconnect.bbinktattoo W/ClassMapper: No setter/field for views found on class com.bbinkconnect.bbinktattoo.model.Story
2019-05-21 18:29:46.205 28351-28746/com.bbinkconnect.bbinktattoo V/FA: Screen exposed for less than 1000 ms. Event not sent. time: 826
2019-05-21 18:29:46.222 28351-28746/com.bbinkconnect.bbinktattoo V/FA: Activity paused, time: 163770103
2019-05-21 18:29:46.246 28351-28351/com.bbinkconnect.bbinktattoo W/ClassMapper: No setter/field for views found on class com.bbinkconnect.bbinktattoo.model.Story
2019-05-21 18:29:46.247 28351-28351/com.bbinkconnect.bbinktattoo W/ClassMapper: No setter/field for views found on class com.bbinkconnect.bbinktattoo.model.Story
2019-05-21 18:29:46.248 28351-28351/com.bbinkconnect.bbinktattoo W/ClassMapper: No setter/field for views found on class com.bbinkconnect.bbinktattoo.model.Story
2019-05-21 18:29:46.250 28351-28351/com.bbinkconnect.bbinktattoo W/ClassMapper: No setter/field for views found on class com.bbinkconnect.bbinktattoo.model.Story
2019-05-21 18:29:46.280 28351-28351/com.bbinkconnect.bbinktattoo W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@14ac2e2
2019-05-21 18:29:46.311 28351-28351/com.bbinkconnect.bbinktattoo V/FA: onActivityCreated
2019-05-21 18:29:46.570 28351-28351/com.bbinkconnect.bbinktattoo D/InputTransport: Input channel constructed: fd=89
2019-05-21 18:29:46.571 28351-28351/com.bbinkconnect.bbinktattoo D/ViewRootImpl@7fd8c45[MainActivity]: setView = DecorView@a0fef9a[MainActivity] TM=true MM=false
2019-05-21 18:29:46.599 28351-28351/com.bbinkconnect.bbinktattoo I/Choreographer: Skipped 33 frames! The application may be doing too much work on its main thread.
2019-05-21 18:29:46.616 28351-28746/com.bbinkconnect.bbinktattoo D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=MainActivity, firebase_previous_id(_pi)=4754157434908249512, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=4754157434908249513}]
2019-05-21 18:29:46.732 28351-28746/com.bbinkconnect.bbinktattoo V/FA: Activity resumed, time: 163770442
2019-05-21 18:29:46.873 28351-28798/com.bbinkconnect.bbinktattoo W/libEGL: EGLNativeWindowType 0x7151c1d010 disconnect failed
2019-05-21 18:29:46.873 28351-28798/com.bbinkconnect.bbinktattoo D/OpenGLRenderer: eglDestroySurface = 0x714aef7800, 0x7151c1d000
2019-05-21 18:29:47.096 28351-28351/com.bbinkconnect.bbinktattoo D/ViewRootImpl@2045607[MainActivity]: Relayout returned: old=[0,0][1080,2220] new=[0,0][1080,2220] result=0x5 surface={valid=false 0} changed=true
2019-05-21 18:29:47.123 28351-28351/com.bbinkconnect.bbinktattoo D/ViewRootImpl@7fd8c45[MainActivity]: dispatchAttachedToWindow
2019-05-21 18:29:47.144 28351-28351/com.bbinkconnect.bbinktattoo D/ViewRootImpl@7fd8c45[MainActivity]: Relayout returned: old=[0,0][1080,2220] new=[0,0][1080,2220] result=0x1 surface={valid=false 0} changed=false
2019-05-21 18:29:47.154 28351-28351/com.bbinkconnect.bbinktattoo E/ViewRootImpl@7fd8c45[MainActivity]: Surface is not valid.
答案 0 :(得分:0)
我完全确定您遇到的问题。但是,我可以指出一些在您更改代码以解决问题时考虑到的有用信息。
首先,让我们考虑以下消息。
未使用平台默认值指定网络安全配置
您需要按照guideline here进行设置,以设置网络配置。
跳过88帧!该应用程序可能对其进行了过多的工作 主线程
正如您已经提到的那样,您的应用程序在其主线程中做了太多工作。因此,您需要检查是否有可能在后台任务中移动任何内容,以便主线程仅执行填充初始视图所需的操作。
在课程中找不到视图的设置器/字段 com.bbinkconnect.bbinktattoo.model.Story
请检查此类,并写二传手的观点,并将二传手公开。
登录后,我认为您正在加载HomeFragment
,这在主线程中工作量很大。如果它正在从网络从主线程加载图像,请考虑使用Glide。
希望对您有所帮助!