Hi I am new to android programming.
Here my problem is…
I designed 2 layouts.
1) R.layout.main: it consists one TextField,one EditText and one Button
2) R.layout.window: it holds 5 buttons
here at first,R.layout.main is displayed.By default R.layout.main is calling so when i press the button of that main layout it needs to forward to r.layout.window.
Forwarding process is ok..
BUT WHEN I MAKE CALL LIKE
BUTTON button=(Button)findViewById(R.id.b1);// b1 is at R.layout.window
i am getting an exception.. SO CAN I KNOW WHICH METHOD WILL BE CALLED WHEN setContentView() IS CALLED and FROM ONCREATE(),IS IT POSSIBLE TO CALL MULTIPLE LAYOUTS R.id.namess..
waiting for reply
try this
if you set the content view to R.layout.main like this
setContentView(R.layout.main);thenyou can access widgets in the
R.layout.mainbyfindViewById()only like thiswhere
R.id.button1insideR.layout.mainthen when you finish withR.layout.mainset the content view of window layout and then access the widgets inside ithope you understand