hey i have been learing java for a while and just have started coding for android last night
i am learing android development off the new boston youtube page
i have created some buttons in xml and assigned them ids and now would like to add an on click listener.
this is my code
eclipse created an onclicklistner but has an error with add
the tutorial i am learning of of is from the late 2000s is there a new way or something have i done something wrong please help
this is my first post yaaah
sorry if this isnt allowed in this section of the forum i see that people are asking question here aswell but when i go to post this threads it says that you cant post it here
any way thxs for ur help in advance
i am learing android development off the new boston youtube page
i have created some buttons in xml and assigned them ids and now would like to add an on click listener.
this is my code
Code:
package com.example.time;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBar;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.os.Build;
public class StartingPoint extends ActionBarActivity {
Button yes,no;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_starting_point);
yes = (Button) findViewById(R.id.bno);
no = (Button) findViewById(R.id.byes);
add.setonClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
}
});
eclipse created an onclicklistner but has an error with add
the tutorial i am learning of of is from the late 2000s is there a new way or something have i done something wrong please help
this is my first post yaaah
sorry if this isnt allowed in this section of the forum i see that people are asking question here aswell but when i go to post this threads it says that you cant post it here
any way thxs for ur help in advance