0

I have this moderately massive application which I have to turn into an Android library. My application extensively depends on ButterKnife, and as per it's limitations I can't use ButterKnife anymore. An alternative to this is using ButterFork. My problem lies in the amount of refactoring I will have to do to change R.id.resource to B.id.resource Is there a shortcut or some work around for this problem? I am aware of the functionality of structural replace in Android Studio, but the thing is don't know how to write the script for replacing R with B

iZBasit
  • 1,314
  • 1
  • 15
  • 30
  • If you're on linux, you could do use `grep -rl 'old_val' ./ | xargs sed -i 's/old_val/new_val/g'` from the root of your java source, if the only change is that actual characters. in your case: `grep -rl 'R.id.' ./ | xargs sed -i 's/R.id./B.id./g'` – Cruceo Apr 14 '16 at 20:08
  • did you find success in converting ? I converted but getting nullpointer exception for views ? can you suggest any solution ? – Logic Apr 27 '16 at 12:42
  • I converted but I had to go and do the changes manually everywhere – iZBasit Apr 27 '16 at 12:45

0 Answers0