I would like to add a custom property to a group of EditTexts that are created programmatically. I have three different sensors set up via an Arduino, and I would like this custom attribute to be used by the app to dictate which sensor to read from.
Is there a way to create a custom attribute so that I can declare the setting like editTextX.setSensorType(0)
?
Here is the code that I'd be using this with:
if (check for certain j value) {
rowjlabel.setText(" %");
// read from tilt sensor, or "dimensionj.setSensorType(tilt);"
} else if (check for other j value) {
rowjlabel.setText(" in.");
// read from height sensor, or "dimensionj.setSensorType(height);"
} else {
rowjlabel.setText(" in.");
//read from distance sensor, or "dimensionj.setSensorType(distance);"
}