i have a button i want three functionality for that
on first click it start recording sound .on second click it will stop on third click it show three options (play sound,record new,delete sound) how can i implement this action
help
k=(Button)findViewById(R.id.button1);
k.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
}
});
You need to set a class level variable and determine what click has transpired. The difficulty in this approach is defining when to reset the value.
A better approach would to simply assign multiple handlers to multiple buttons and perform the action needed for the button. This would allow you to define a 1:1 relationship and will make your code much more manageable down the road.
EDIT: To record sound there are plenty of examples on the web.