我在主Activity(NavigationActivity)中遇到了内存泄漏问题。
public static NavigationActivity navigationActivity;
public static NavigationActivity getNavigationActivity() {
return navigationActivity;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_navigation);
navigationActivity = NavigationActivity.this;
}
@Override
protected void onDestroy() {
super.onDestroy();
if (navigationActivity != null) {
navigationActivity = null;
}
}
哪里泄漏?如何修复它?非常感谢您的帮助。