Rename Method re-factoring not only rename the variables but anywhere including comments (it can not be sure if string in comments is really variable name).
For example:
class ABC{ private String username; private void X(){ String str = "username"; } }
Now, after renaming the class member username
, Android Studio will Behave like:
class ABC{ private String mUsername; private void X(){ String str = "mUsername"; // it should be remain same as String str = "username"; } }
Is there any way to change the Re-factoring Setting in Android Studio?
After a struggle, i got the solution. During re-factoring/renaming the variable/member, it will display a popup. In this popup, you will see a sentence
"Press Shift+F6 to show dialog with more options"
Now if you will press "Shift+F6", a dialog will open for Re-factor-Setting.
Here, un-check "Search in comments and strings"
.. Thats it..
Thanks for replies..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With