Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android programming m before objects [duplicate]

I am new in Android programming, and I saw there is a "m" before objects, like:

mCursor

mAdpter

mView


So what is this "m"? Should I use it in my code?

Sorry for this poor question...

like image 625
User Avatar asked Sep 26 '14 23:09

User


1 Answers

Follow Field Naming Conventions

  1. Non-public, non-static field names start with m.
  2. Static field names start with s.
  3. Other fields start with a lower case letter.
  4. Public static final fields (constants) are ALL_CAPS_WITH_UNDERSCORES.

You can see the document on those rules here.

like image 99
Peter Pei Guo Avatar answered Oct 15 '22 03:10

Peter Pei Guo