gpt4 book ai didi

java - 运行时出错 'RegistrationActivity' : The activity must be exported or contain an intent-filter

转载 作者:行者123 更新时间:2023-12-01 22:50:10 26 4
gpt4 key购买 nike

enter image description here

<小时/>

我无法运行我的registrationActivity,因为它给了我错误:

The activity must be exported or contain an intent-filter

我不知道如何解决,我应该在我的 Android list 中放入什么?

此外,我还得到了java.lang.NullPointerException 以及下面的 if:

protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_registration);

mAuth = FirebaseAuth.getInstance();
firebaseAuStateListener = new FirebaseAuth.AuthStateListener() {
@Override
public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
final FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
if (user != null){
Intent intent = new Intent(RegistrationActivity.this, MainActivity.class);
startActivity (intent);
finish();
return;
}
}
}
}

最佳答案

将其放入您的 androidmanifest.xml

在应用程序标签内

<activity
android:name=".YOURACTIVTYNAME">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

关于java - 运行时出错 'RegistrationActivity' : The activity must be exported or contain an intent-filter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58459730/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com