I am showing data of a <string name="whatsnew"> </string> in a textview and i have to show this textview only when the text inside this being changed.
for eg:
If previous state is:
<string name="whatsnew">Hi Stackoverflow Collegues </string>
If current state is this data is being updated as:
<string name="whatsnew">Hello Stackoverflow Collegues</string>
I have implemented a logic that i will retrieve the previous and current stringlength of
<string name="whatsnew"> </string>
containing text.But this logic has a loop hole if the updated text is of same length of previous string length.
Please help me with a better and efficient logic.
use hashCode() of your string to compare, for example:
or simply compare with another string: