Answer the question
In order to leave comments, you need to log in
else java android not working?
private int currentId = 0;
.....
public void onStartClicked() {
Log.d(TAG, "start button clicked");
if (lvData.getId() == currentId){
Log.d(TAG, "виполнилось условие if");
m_stopwatchService.start();
}
else {
Log.d(TAG, "виполнилось условие else");
m_stopwatchService.reset();
m_stopwatchService.start();
}
currentId=lvData.getId();
showPauseButton();
}
Answer the question
In order to leave comments, you need to log in
Thanks, I decided =) I get the position from the onItemClick method and set it equal to its value, then it works
From the piece of code that you gave, we can only assume that id is always equal to currentId.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question