Errors in ListView Customization

3

Well, I've been trying to customize a ListView in my project, I've finished and everything was fine. But there was an API error stating that the minimum API I used was too low. I used the eclipse fix option without knowing if it was official, the error disappeared and then I tried to run the APK. Unfortunately it did not open and the system reported that the application stopped.

I thought the API error was responsible for this. I tried to create another project with a higher minimum API, but when copying the code several errors appeared. The GETs I used in one of the classes stopped working for no apparent reason. I am having an error in ActionBarActivity in another class. When importing, it gets the yellow scratch underneath and stops working, as does the import of it. If I remove the import, it will turn red. Also, and I'm not sure what the reason is. It follows the screenshots of those of the classes that present errors.

    
asked by anonymous 21.11.2015 / 21:00

1 answer

1

The risk is a warning that the class you are using is obsolete, this can be confirmed in the class's own documentation ActionBarActivity . You can use the AppCompatActivity class as a that you do not make use of some critical resource of the obsolete class, then the recommended one is you to revise its code, in order to adapt the functionalities for the new class.

As for the error of the methods itemPosicao , may be because you should be using the android class is also called ClipData.item . Check if you have correctly imported your custom item class instead of the android class, and if the itemPosicao variable is of the type of your item class or the native android class type.

As a suggestion, you could change the name of your custom class, preventing it from conflicting with native classes, using names that best define what kind of item it is about. An example on the android itself is menu has menuItem .

References:

Android Documentation

    
21.11.2015 / 22:35