In the onCreate() method of my class I make a grid of buttons, and give them tags to identify them, for example:
String s = "one four";
Object o = s;
View view = new View(this);
Button button = (Button)view.findViewWithTag(o);
You must call
And you dont need to do this
Object o = s;,
view.findViewWithTag(s); will do the same.
View view = new View(this); - you create a new instance of View. Object view does not have any childs. You must call findViewWithTag(s) method from layout which contains your Button object.