Problem: I load my class, the setOnItemSelectedListener function runs and sets variable wattage to a specific value, depending on what item was selected in th
Use the code below:
// if false it means we're dealing with the initial selection so we should ignore it
private boolean mFlag = false;
mEdit.setOnItemSelectedListener(new OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
if (!mFlag) {
// from this moment on the selection will be accepted
mFlag = true;
return;
}
// ...rest of code...