For my Android project, I am using the getID() method to retrieve the numeric value for a View and store this value in my database. I am banking that this getID() method for a particular View will always return the same constant value over multiple executions in a production environment and over subsequent application changes over years. Is my assumption correct?
For my Android project, I am using the getID() method to retrieve the numeric
Share
View#getId()is the value ofR.id.xyzyou define in your layout xml files. They don’t change until you recompile your app since that changes the generated R.java file (not necessarily changing the numeric id value though).yes, if the app is not updated
maybe, but I would not assume that. There is maybe a way to setup your tools to generate predetermined fix id values since Android itself has stable resource ids but Idk how that is done.