i need to get the butting id which is not defined in R.layout.activity_main.xml file.Currently i am getting error for phone=(Button)findViewById(R.id.phone);.Because its definde in another xml file.can anyone help me.
posted 3 years ago
You can only get a reference to a GUI element that is part of a view that is inflated. It doesn't sound as if that would be the case in your code.
What do you propose to do with a reference to a GUI element that doesn't (yet) exist?