So I want a button to show the next layout and Im looking through the resource on Android.com but there is something wrong.
Might be me but anyways.
Here is the code
Using java Syntax Highlighting
- package com.markel.NSF;
- import android.app.Activity;
- import android.os.Bundle;
- import android.view.View;
- import android.view.View.OnClickListener;
- import android.widget.Button;
- public class MerkerActivity extends Activity {
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.alder);
- }
- // Button for bever merker
- Button bever = (Button)findViewById(R.id.bever);
- button.setOnClickListener(R.id.bever);
- // Implement the OnClickListener callback
- public void onClick(View v) {
- setContentView(R.layout.bmerk1);
- }
- }
Parsed in 0.013 seconds, using GeSHi 1.0.8.4
No matter what I do I cant seem to get the button.setOnClickListner to work. I have tried using this as token.
I would like some help to sort this out..