Yes, the problem is the button declaration, write the code below instead of the code, it will solve your problem.
public class Menu extends Activity implements OnClickListener{ Button loginbutton, recordbutton, viewbutton, projectsbutton; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.menu); loginbutton = (Button) findViewById(R.id.butlogin); loginbutton.setOnClickListener(this); recordbutton = (Button) findViewById(R.id.butrecordts); recordbutton.setOnClickListener(this); viewbutton = (Button) findViewById(R.id.butviewts); viewbutton.setOnClickListener(this); projectsbutton = (Button) findViewById(R.id.butprojects); projectsbutton.setOnClickListener(this); } public void onClick(View v){ switch(v.getId()) { case R.id.butlogin: {
source share