我在某些Android设备上运行我的应用程序时遇到问题。启动屏幕活动停止运行之后。
但是在较旧的设备中,应用程序可以正常运行。
等级:
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.simcoder.tinder"
minSdkVersion 19
targetSdkVersion 26
我有3种布局作为响应式布局:
调试代码
> 2019-03-15 10:49:03.527 20943-20943/com.coder.t V/InputMethodManager:
> Starting input: tba=android.view.inputmethod.EditorInfo@2a87464 nm :
> com.coder.t ic=null 2019-03-15 10:49:03.527 20943-20943/com.coder.t
> D/InputMethodManager: startInputInner - Id : 0 2019-03-15 10:49:03.527
> 20943-20943/com.coder.t I/InputMethodManager: startInputInner -
> mService.startInputOrWindowGainedFocus 2019-03-15 10:49:03.531
> 20943-20943/com.coder.t D/InputTransport: Input channel constructed:
> fd=87 2019-03-15 10:49:03.531 20943-20943/com.coder.t
> D/InputTransport: Input channel destroyed: fd=81 2019-03-15
> 10:49:03.565 20943-20967/com.coder.t D/OpenGLRenderer:
> eglDestroySurface = 0xdb88cac0, 0xc4f4a800 2019-03-15 10:49:03.578
> 20943-20943/com.coder.t
> D/ViewRootImpl@f1dbeba[secondtimeloaddigActivity]: Relayout returned:
> old=[0,0][720,1280] new=[0,0][720,1280] result=0x5
> surface={valid=false 0} changed=true 2019-03-15 10:49:03.599
> 20943-20967/com.coder.t D/OpenGLRenderer: eglDestroySurface =
> 0xdb88cd18, 0xc4d1d800 2019-03-15 10:49:03.610 20943-20943/com.coder.t
> D/ViewRootImpl@21d4340[AfterSplashLoadingActivity]: Relayout returned:
> old=[0,0][720,1280] new=[0,0][720,1280] result=0x5
> surface={valid=false 0} changed=true 2019-03-15 10:49:03.613
> 20943-20967/com.coder.t D/OpenGLRenderer: eglDestroySurface =
> 0xdb88c070, 0xc6312800 2019-03-15 10:49:03.623 20943-20943/com.coder.t
> D/ViewRootImpl@6801b67[splashActivity]: Relayout returned:
> old=[0,0][720,1280] new=[0,0][720,1280] result=0x5
> surface={valid=false 0} changed=true 2019-03-15 10:49:03.799
> 20943-20943/com.coder.t
> D/ViewRootImpl@21d4340[AfterSplashLoadingActivity]:
> dispatchDetachedFromWindow 2019-03-15 10:49:03.799
> 20943-20943/com.coder.t D/InputEventReceiver: channel '5c7830
> com.coder.t/com.coder.t.AfterSplashLoadingActivity (client)' ~
> Disposing input event receiver. 2019-03-15 10:49:03.799
> 20943-20943/com.coder.t D/InputEventReceiver: channel '5c7830
> com.coder.t/com.coder.t.AfterSplashLoadingActivity (client)'
> ~NativeInputEventReceiver. 2019-03-15 10:49:03.804
> 20943-20943/com.coder.t D/InputTransport: Input channel destroyed:
> fd=80 2019-03-15 10:49:03.813 20943-20943/com.coder.t
> D/ViewRootImpl@6801b67[splashActivity]: dispatchDetachedFromWindow
> 2019-03-15 10:49:03.813 20943-20943/com.coder.t D/InputEventReceiver:
> channel '2cc9bc5 com.coder.t/com.coder.t.splashActivity (client)' ~
> Disposing input event receiver. 2019-03-15 10:49:03.813
> 20943-20943/com.coder.t D/InputEventReceiver: channel '2cc9bc5
> com.coder.t/com.coder.t.splashActivity (client)'
> ~NativeInputEventReceiver. 2019-03-15 10:49:03.818
> 20943-20943/com.coder.t D/InputTransport: Input channel destroyed:
> fd=61
有人可以向我解释这个问题吗?
更新-我在活动中的Firebase代码
public class AfterSplashLoadingActivity extends AppCompatActivity {
private FirebaseAuth mAuth;
private FirebaseAuth.AuthStateListener firebaseAuthStateListener;
private FirebaseAuth.AuthStateListener firebaseAuthStateListener2;
private DatabaseReference usersDb,usersDb2 ;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_after_splash_loading);
mAuth = FirebaseAuth.getInstance();
firebaseAuthStateListener = new FirebaseAuth.AuthStateListener() {
@Override
public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
final FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
if (user !=null){
Intent intent = new Intent(AfterSplashLoadingActivity.this, secondtimeloaddigActivity.class);
startActivity(intent);
finish();
return;
}
}
};
firebaseAuthStateListener2 = new FirebaseAuth.AuthStateListener() {
@Override
public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
final FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
if (user ==null){
Intent intent = new Intent(AfterSplashLoadingActivity.this, seekersmsoremailActivity.class);
startActivity(intent);
finish();
return;
}
}
};
}
@Override
protected void onStart() {
super.onStart();
mAuth.addAuthStateListener(firebaseAuthStateListener);
mAuth.addAuthStateListener(firebaseAuthStateListener2);
}
@Override
protected void onStop() {
super.onStop();
mAuth.removeAuthStateListener(firebaseAuthStateListener);
mAuth.addAuthStateListener(firebaseAuthStateListener2);
}
}