I'm trying to add a method to the Chronometer class in android. It stores the start time in this variable:
private long mBase;
so I thought I could do this
public class MyChronometer extends Chronometer{
public void reset(){
long now = SystemClock.elapsedRealtime();
this.mBase = now;
}
}
but Android Studio is telling me that mBase
can't be found. Why is this? And what am I doing wrong? From what I understand of inheritance in Java, if I extend a class then I have all of the methods and variables of the class I extend which I can then add to. Is this incorrect? Wouldn't this include the mBase
variable even though it is private?
Edit: Essentially I am trying to create a setter function for mBase