Problem with spinner selection

Asked

Viewed 44 times

0

I have been running a project and found the following problem(s):

endAllActiveAnimators on 0xd0f0b880 (Dropdownlistview) with Handle 0xdd169490

I don’t know what you mean, can someone help me? Here is my code from Activity:

   public class RegisterActivity extends AppCompatActivity {

Spinner spinnerBreed;

RadioButton radioDog;
RadioButton radioCat;
RadioButton radioBird;

List<String> spinnerArray;
List<String> spinnerDog;
List<String> spinnerCat;
List<String> spinnerBird;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_register);
    getSupportActionBar().hide();

    spinnerArray = new ArrayList<String>();

    spinnerDog =  new ArrayList<String>();
    spinnerDog.add("Labrador");
    spinnerDog.add("Pinscher");
    spinnerDog.add("Pit bull");
    spinnerDog.add("Poodle");
    spinnerDog.add("Rottweiler");
    spinnerDog.add("Terrier");
    spinnerDog.add("Outro...");

    spinnerCat = new ArrayList<String>();
    spinnerCat.add("Himalaia");
    spinnerCat.add("Persa");
    spinnerCat.add("Siamês");
    spinnerCat.add("Sphynx");
    spinnerCat.add("Outro...");

    spinnerBird = new ArrayList<String>();
    spinnerBird.add("Canário");
    spinnerBird.add("Calopsita");
    spinnerBird.add("Calafete");
    spinnerBird.add("Cacatua");
    spinnerBird.add("Outro...");

    radioDog = (RadioButton) findViewById(R.id.radioDog);
    radioDog.setOnClickListener(clickDog);
    radioCat = (RadioButton) findViewById(R.id.radioCat);
    radioCat.setOnClickListener(clickCat);
    radioBird = (RadioButton) findViewById(R.id.radioBird);
    radioBird.setOnClickListener(clickBird);

    spinnerBreed = (Spinner) findViewById(R.id.spinnerRace);

    /*

     */

    ArrayAdapter<String> adapter = new ArrayAdapter<String>(
            this, android.R.layout.simple_spinner_item, spinnerArray);
    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);

    spinnerBreed.setAdapter(adapter);
    spinnerBreed.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
        @Override
        public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {

            String selectedText = spinnerBreed.getSelectedItem().toString();
            TextView breed = (TextView) findViewById(R.id.textBreedAnimal);

            if (selectedText.isEmpty()){
                breed.setText(R.string.notRun);
            }else{
                breed.setText(selectedText);
            }

        }
        public void onNothingSelected(AdapterView<?> adapterView) {

        }
    });
}

View.OnClickListener clickDog = new View.OnClickListener() {
    @Override
    public void onClick(View view) {
        spinnerArray.clear();
        spinnerArray.addAll(spinnerDog);
    }
};

View.OnClickListener clickCat = new View.OnClickListener() {
    @Override
    public void onClick(View view) {
        spinnerArray.clear();
        spinnerArray.addAll(spinnerCat);
    }
};

View.OnClickListener clickBird = new View.OnClickListener() {
    @Override
    public void onClick(View view) {
        spinnerArray.clear();
        spinnerArray.addAll(spinnerBird);
    }
};
}

Here is my code from layout of Activity:

    [...]
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="@dimen/leftItemMargin"
            android:layout_marginTop="@dimen/topItemMargin">

            <Spinner
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/spinnerRace"/>

            <TextView
                android:text="Selecione a raça do animal"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:layout_alignParentLeft="true"
                android:layout_alignParentStart="true"
                android:layout_marginLeft="80dp"
                android:layout_marginStart="80dp"
                android:textColor="#000000"
                android:id="@+id/textBreedAnimal"/>
        </RelativeLayout>
    [...]

Here is my log:

   [ 12-23 13:48:57.481  2823: 2823 D/         ]
   HostConnection::get() New Host Connection established 0xdd731ec0, tid  2823
    D/libEGL: Emulator has host GPU support, qemu.gles is set to 1.
    E/libEGL: load_driver(/system/lib/egl/libGLES_emulation.so): dlopen     failed: library "/system/lib/egl/libGLES_emulation.so" not found
    D/libEGL: loaded /system/lib/egl/libEGL_emulation.so
    D/libEGL: loaded /system/lib/egl/libGLESv1_CM_emulation.so
    D/libEGL: loaded /system/lib/egl/libGLESv2_emulation.so

      [ 12-23 13:49:07.399  2823: 2853 D/         ]
      HostConnection::get() New Host Connection established 0xdd74b210, tid 2853
    I/OpenGLRenderer: Initialized EGL, version 1.4
    D/OpenGLRenderer: Swap behavior 1
    I/Choreographer: Skipped 1457 frames!  The application may be doing too much work on its main thread.
    I/Choreographer: Skipped 270 frames!  The application may be doing too much work on its main thread.
    I/Choreographer: Skipped 83 frames!  The application may be doing too much work on its main thread.
    D/OpenGLRenderer: endAllActiveAnimators on 0xd0fe4b80 (DropDownListView) with handle 0xdd169280
    I/Choreographer: Skipped 40 frames!  The application may be doing too much work on its main thread.
    I/Choreographer: Skipped 42 frames!  The application may be doing too much work on its main thread.
    D/OpenGLRenderer: endAllActiveAnimators on 0xd0f0b880 (DropDownListView) with handle 0xdd169490

Thank you for your attention!

  • Do you know which line gives the error?

  • No :/ Suspected error not being in the code

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.