A Follow up to this question: http://stackoverflow.com/questions/3488880/group-of-views-controls-on-multiple-screens
I have created a parent class and a child class that inherits from it. When I set the OnClickListener in the child class, the event fires when the button is clicked. When I move the set OnClickListener to the parent class, the event doesn't fire. I've got to be missing something obvious but I just don't see it.
Thanks, Cameron.
Parent Class:
public class NavigationMenu extends Activity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.nav_bar);
Button loginButton = (Button) findViewById(R.id.navbtnHome);
loginButton.setOnClickListener(new View.OnClickListener()
{
public void onClick(View view)
{
Toast.makeText(getApplicationContext(), "Cameron, Im here", Toast.LENGTH_SHORT).show();
Intent i = new Intent(NavigationMenu.this, Login.class);
startActivity(i);
}
});
}
}
Child Class:
public class Settings extends NavigationMenu
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.settings);
}
}