Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception after calling onDestroy() method in DrinkCategoryActivity.java in Chapter 12 #11

Open
ceyeep opened this issue Jun 29, 2016 · 0 comments

Comments

@ceyeep
Copy link

ceyeep commented Jun 29, 2016

A NullPointerException may occur in DrinkCategoryActivity.java from Chapter 12 after calling the onDestroy() method if "cursor" or "db" objects are null (e.g., after rotating the device when having the Drink Categories list on screen).

@Override public void onDestroy() { super.onDestroy(); cursor.close(); db.close(); }

Need to do a null check on variables "cursor" and "db".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant