Android SQLite ID field return 0 on query and how to fix

Lately I ran into a strange problem (for beginners maybe). This is the query I used to create a table:

However, after inserting few rows, I queried back and always got the ID field as null.

So I changed to this

And it worked properly now.

 

Why it happened?

I discovered that in the first query, somehow the INTEGER and AUTOINCREMENT stick together and there was a new type created INTEGERAUTOINCREMENT.

 

It could be a bug in Android Studio, I don’t know for sure.

Hope that helps someone who has the same problem.