Even though this is not the recommended way to handle this, a quick suggestion would be to add these two lines again after you do setContentView(R.layout.intropage_landscape);
btnlogin = (Button)findViewById(R.id.btnlogin);
btnlogin.setOnClickListener(this);
Recommended way is:
- Not to call
setContentView
for each orientation. CallsetContentView
once inonCreate
and initialize all the UI elements. - Then re-use the common UI elements for both orientation
- If there are some non common UI elements, then use fragments to add and remove as necessary.
Hope this helps.