How to verify whether a text is the same as the string in position of the
array mentioned and do a corresponding job?
Okay, I want that if the text 'A' is same as the text as in the string in
an array at the position 0 / 1, send an SMS 'A is correct' to 5666 when I
click on the button 'b0'? and that if the text 'B' is same as the text as
in the string in an array at the position 0 / 1, send an SMS 'B is
correct' to 5666 when I click on the button 'b1'????
Code :
@Override
public void onClick(View arg0) {
switch(arg0.getId()) {
case R.id.b0:
if ("A".equals(names[0]))
sendSMS("5666", "A");
else if ("B".equals(names[0]))
sendSMS("5666", "B");
case R.id.b0:
if ("A".equals(names[1]))
sendSMS("5666", "A");
else if ("B".equals(names[1]))
sendSMS("5666", "B");
}
}
Now, suppose names[0]=A and names[1]=B , it does the work of sending "A"
to 5666 when I click button b0 but it doesn't send "B" to 5666 when I
click button b1!
No comments:
Post a Comment