1. Are you ready for the Galaxy S20? Here is everything we know so far!

Problem with Selected value in a Spinner

Discussion in 'Android Development' started by AbdouMike, Jun 18, 2019.

  1. AbdouMike

    AbdouMike Lurker
    Thread Starter

    Hello,

    I have a big problem: When I fill a spinner dynamically with data from a table in a database and want to select a value, this value does not remain displayed, it disappears immediately. (and I only have the little arrow of the Spinner that remains displayed!). I use Android Studio 3.4.1
    Thank you for your answer that I hope very fast because I am stuck on this point for several days!

    (When the spinner is filled by a static list, there is no problem!)

    Best wishes
     

    Advertisement

  2. Deleted User

    Deleted User Guest

    If you could include your code here that would be a great help to solving your problem.
    Please use [code][/code] tags to nicely format any code you include.
     
    Mikestony likes this.
  3. AbdouMike

    AbdouMike Lurker
    Thread Starter

    Hello,
    Firstly, I'm very sorry to answer you with some late (I was in travel and also ill).

    Secondly, The tutorial I try the follow and practice is :
    - https://androidjson.com/android-json-parsing-listview-php-mysql/

    Her's attached, the files that, I think, you need to understand my problem and try to resolve it:

    - select_niveau.php (To have the data from the table in Json Format)

    - The Acticity 'activity_interface_saisie_eleve.xml' that contains the Layout which contains : the spinners (3), and the Other components (It's Not 'The MainActivity' !)

    - interface_saisie_eleve.java (It contains another class 'GetHttpResponse', and in this last class, I populate the 'niveauList' List with the 'Niveaux' class (List<Niveaux> niveauList); And here also I Use the adapter 'ListAdapterNiveauClass' to populate the 'list_niveau_eleve' Spinner dynamicly with the data from the DB.

    - The 'Niveaux' class

    - The adapter : 'ListAdapterNiveauClass', Using the the 'layout_items.xml' Layout

    - The 'layout_items.xml' Layout

    The issue is that I can populate the 'list_niveau_eleve' Spinner with the data from the table . But the PROBLEM is that when I select a value in the spinner, this value DISAPEAR Immediatlly (It doesn't stay displayed in the Spinner! All I can see 'displayed' is the 'poor' arrow of the Spinner! .

    I noticed that the system ( https://androidforums.com/threads/problem-with-selected-value-in-a-spinner.1307185/add-reply) Accept Only the text Format as attached File, So I renamed all my Files :.txt (include: .php, .xml, .java)

    I'm at your disposal if you need more Information

    Thank you Very Much for your help and answer to solve the problem that I hope rapid, because I'm blocked with this Problem since 12 days!

    Best regards,
     

    Attached Files:

Loading...

Share This Page

Loading...