Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
public class Temporary_contact extends ActionBarActivity implements OnClickListener {
	private int mYear, mMonth, mDay, mHour, mMinute;
	 
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.temporary_reg);
		 Contact_db_handle db = new Contact_db_handle(this);
		Button save_contacts=(Button)findViewById(R.id.save);
TextView settime=(TextView)findViewById(R.id.Set_time);	 
	TextView setdate=(TextView)findViewById(R.id.Set_date);
		setdate.setOnClickListener(this);
		settime.setOnClickListener(this);
		save_contacts.setOnClickListener(this);	

}
public void onClick(View v) {
if(v==settime)//error on this line 
{

}
}

i have applied click listener but i am not able to get the get settime and not able to access any value like db ?
Posted
Updated 14-Sep-14 22:09pm
v3

1 solution

Java
if(v==settime)

Should be
Java
if(v.getId() == settime.getId())
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900