IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Android Discussion :

Problème algo ?


Sujet :

Android

  1. #1
    Membre à l'essai
    Profil pro
    Inscrit en
    Avril 2010
    Messages
    24
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2010
    Messages : 24
    Points : 11
    Points
    11
    Par défaut Problème algo ?
    Bonjour à tous,

    J'ai un problème dans mon code qui me retourne une erreur à l'exécution qui me force la fermeture de l'appli.

    En fait, je réalise un enregistrement d'un fichier d'une part et de l'autre je stock le nom de ce fichier afin de pouvoir faire un reset à la demande de l'utilisateur ce qui supprimerai tous les fichier créé.

    Voilà le code de l'enregistrement :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    public void WriteSettings(Context context, String data){ 
        	this.tabwidget.tabVille("lyon.dat"); //ERREUR ICI
        	FileOutputStream fOut = null; 
            OutputStreamWriter osw = null;
            try{ 
            	deleteFile("lyon.dat");
            	fOut = context.openFileOutput("lyon.dat",MODE_APPEND);
     
                osw = new OutputStreamWriter(fOut); 
     
                osw.write(data); 
                osw.flush(); 
               //popup pour le résultat
                Toast.makeText(context, "Enregistrement réussit",Toast.LENGTH_SHORT).show();
                ReadSettings(this);
     
                } 
                catch (Exception e) {       
                        Toast.makeText(context, "Settings not saved",Toast.LENGTH_SHORT).show(); 
                } 
                finally { 
                   try { 
                          osw.close(); 
                          fOut.close(); 
                          } catch (IOException e) { 
                                   Toast.makeText(context, "Settings not saved",Toast.LENGTH_SHORT).show(); 
                          } 
                } 
           }
    J'envoie donc le nom du fichier dans la class "TabWidget" avec le code suivant :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    public String[] tabVille(String nomVille){
    		int i = 0;
    		Toast.makeText(this, "tabVille", 1000).show();
    		while (ville[i]!=null){
    			i++;
    		}
    		ville[i]= nomVille;
    		Toast.makeText(this, "tabVille OK", 1000).show();
    		return ville;
     
    	}


    Voilà je vous ai commenté l'endroit où l'erreur ce produit. Je ne voix pas d'où ça peut venir... Si quelqu'un a une idée je suis preneur !

    Merci par avance et bonne journée à tous

  2. #2
    Membre régulier
    Profil pro
    Inscrit en
    Juin 2008
    Messages
    179
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2008
    Messages : 179
    Points : 100
    Points
    100
    Par défaut
    type de l ' erreur ?

  3. #3
    Membre expert

    Homme Profil pro
    Consultant informatique
    Inscrit en
    Janvier 2004
    Messages
    2 301
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Suisse

    Informations professionnelles :
    Activité : Consultant informatique
    Secteur : Finance

    Informations forums :
    Inscription : Janvier 2004
    Messages : 2 301
    Points : 3 675
    Points
    3 675
    Par défaut
    Je vois pas mal de cas qui peuvent planter...

    Notament, que se passe-t-il lorsque le tableau "ville" est plein et que tu appelles la méthode tabVille?

    Réponse: ArrayIndexOutOfBoundsException...


    "Le plug gros problème des citations trouvées sur internet, c'est qu'on ne peut jamais garantir leur authenticité"

    Confucius, 448 av. J-C

  4. #4
    Membre à l'essai
    Profil pro
    Inscrit en
    Avril 2010
    Messages
    24
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2010
    Messages : 24
    Points : 11
    Points
    11
    Par défaut
    Merci pour vos réponses,

    Je ne sais pas quel est le type d'erreur... Comment puis-je savoir ?

    Par contre je pense que le problème vient lors de l'appel car aucun Toast n'apparait... Donc la fonction tabVille ne se lance meme pas...

    @ Pill_S : comment faire pour résoudre ce problème ? Dans mon cas, quel est la taille maximum de mon tableau ? C'est une valeur par défault ?

    Encore merci

  5. #5
    Membre à l'essai
    Profil pro
    Inscrit en
    Avril 2010
    Messages
    24
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2010
    Messages : 24
    Points : 11
    Points
    11
    Par défaut
    Alors voilà le LogCat :


    04-22 08:09:01.636: WARN/dalvikvm(1506): threadid=3: thread exiting with uncaught exception (group=0x4000fe70)
    04-22 08:09:01.646: ERROR/AndroidRuntime(1506): Uncaught handler: thread main exiting due to uncaught exception
    04-22 08:09:01.667: ERROR/AndroidRuntime(1506): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.LocProMobile.android/com.LocProMobile.android.VegaLyon}: java.lang.NullPointerException
    04-22 08:09:01.667: ERROR/AndroidRuntime(1506): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)
    04-22 08:09:01.667: ERROR/AndroidRuntime(1506): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)
    04-22 08:09:01.667: ERROR/AndroidRuntime(1506): at android.app.ActivityThread.access$1800(ActivityThread.java:112)
    04-22 08:09:01.667: ERROR/AndroidRuntime(1506): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
    04-22 08:09:01.667: ERROR/AndroidRuntime(1506): at android.os.Handler.dispatchMessage(Handler.java:99)
    04-22 08:09:01.667: ERROR/AndroidRuntime(1506): at android.os.Looper.loop(Looper.java:123)
    04-22 08:09:01.667: ERROR/AndroidRuntime(1506): at android.app.ActivityThread.main(ActivityThread.java:3948)
    04-22 08:09:01.667: ERROR/AndroidRuntime(1506): at java.lang.reflect.Method.invokeNative(Native Method)
    04-22 08:09:01.667: ERROR/AndroidRuntime(1506): at java.lang.reflect.Method.invoke(Method.java:521)
    04-22 08:09:01.667: ERROR/AndroidRuntime(1506): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
    04-22 08:09:01.667: ERROR/AndroidRuntime(1506): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
    04-22 08:09:01.667: ERROR/AndroidRuntime(1506): at dalvik.system.NativeStart.main(Native Method)
    04-22 08:09:01.667: ERROR/AndroidRuntime(1506): Caused by: java.lang.NullPointerException
    04-22 08:09:01.667: ERROR/AndroidRuntime(1506): at com.LocProMobile.android.VegaLyon.WriteSettings(VegaLyon.java:233)
    04-22 08:09:01.667: ERROR/AndroidRuntime(1506): at com.LocProMobile.android.VegaLyon$4.onRatingChanged(VegaLyon.java:111)
    04-22 08:09:01.667: ERROR/AndroidRuntime(1506): at android.widget.RatingBar.dispatchRatingChange(RatingBar.java:308)
    04-22 08:09:01.667: ERROR/AndroidRuntime(1506): at android.widget.RatingBar.onProgressRefresh(RatingBar.java:252)
    04-22 08:09:01.667: ERROR/AndroidRuntime(1506): at android.widget.ProgressBar.doRefreshProgress(ProgressBar.java:492)
    04-22 08:09:01.667: ERROR/AndroidRuntime(1506): at android.widget.ProgressBar.refreshProgress(ProgressBar.java:501)
    04-22 08:09:01.667: ERROR/AndroidRuntime(1506): at android.widget.ProgressBar.setProgress(ProgressBar.java:550)
    04-22 08:09:01.667: ERROR/AndroidRuntime(1506): at android.widget.ProgressBar.setProgress(ProgressBar.java:531)
    04-22 08:09:01.667: ERROR/AndroidRuntime(1506): at android.widget.RatingBar.setRating(RatingBar.java:188)
    04-22 08:09:01.667: ERROR/AndroidRuntime(1506): at com.LocProMobile.android.VegaLyon.onCreate(VegaLyon.java:135)
    04-22 08:09:01.667: ERROR/AndroidRuntime(1506): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
    04-22 08:09:01.667: ERROR/AndroidRuntime(1506): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)
    04-22 08:09:01.667: ERROR/AndroidRuntime(1506): ... 11 more
    04-22 08:09:01.706: INFO/Process(577): Sending signal. PID: 1506 SIG: 3
    04-22 08:09:01.706: INFO/dalvikvm(1506): threadid=7: reacting to signal 3
    04-22 08:09:01.846: INFO/dalvikvm(1506): Wrote stack trace to '/data/anr/traces.txt'
    Je ne l'ai pas pris en entier simplement les erreurs.

    Merci pour votre aide en tout cas !

  6. #6
    Membre expert

    Homme Profil pro
    Consultant informatique
    Inscrit en
    Janvier 2004
    Messages
    2 301
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Suisse

    Informations professionnelles :
    Activité : Consultant informatique
    Secteur : Finance

    Informations forums :
    Inscription : Janvier 2004
    Messages : 2 301
    Points : 3 675
    Points
    3 675
    Par défaut
    Citation Envoyé par Flow07 Voir le message
    @ Pill_S : comment faire pour résoudre ce problème ? Dans mon cas, quel est la taille maximum de mon tableau ? C'est une valeur par défault ?
    c'est "montableau.length"

    et ton erreur se trouve là:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    04-22 08:09:01.667: ERROR/AndroidRuntime(1506): at com.LocProMobile.android.VegaLyon.WriteSettings(VegaLyon.java:233)

    "Le plug gros problème des citations trouvées sur internet, c'est qu'on ne peut jamais garantir leur authenticité"

    Confucius, 448 av. J-C

  7. #7
    Membre à l'essai
    Profil pro
    Inscrit en
    Avril 2010
    Messages
    24
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2010
    Messages : 24
    Points : 11
    Points
    11
    Par défaut
    Oui il y a un NullPointerException ce qui veut dire que TabWidget n'est pas initialiser est vaut null c'est bien ça ?
    Par contre vu qu'il s'agit d'une activity, comment faire pour qu'elle soit initialisé ?

    Merci pour ton aide.

  8. #8
    Membre régulier
    Profil pro
    Inscrit en
    Juin 2008
    Messages
    179
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2008
    Messages : 179
    Points : 100
    Points
    100
    Par défaut
    oui ca veut dire tout simplement que ton tab pointe sur un element vide

    utilse le devermineur pour voir ce qu ' il n arrive pas a recuperer precisement

  9. #9
    Rédacteur
    Avatar de MrDuChnok
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Juin 2002
    Messages
    2 112
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Produits et services télécom et Internet

    Informations forums :
    Inscription : Juin 2002
    Messages : 2 112
    Points : 4 240
    Points
    4 240
    Par défaut
    Salut,

    Je n'ai pas bien saisie le découpage de ton application.
    Tu as deux activity ? Et c'est sur la première que tu enregistres ton fichier et c'est dans la deuxième que tu stockes les informations sur le nom des villes ?
    Si vous jugez mon post utile dans la résolution de votre problème, n'hésitez pas à utiliser le système de vote afin d'améliorer la qualité du forum

  10. #10
    Membre à l'essai
    Profil pro
    Inscrit en
    Avril 2010
    Messages
    24
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2010
    Messages : 24
    Points : 11
    Points
    11
    Par défaut
    J'ai trouvé d'où venait le problème, je n'avais pas instancier TabWidget.

    J'ai donc rajouter :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    tabwidget = new TabWidget();
    Mais ça ne marche toujours pas...

  11. #11
    Rédacteur
    Avatar de MrDuChnok
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Juin 2002
    Messages
    2 112
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Produits et services télécom et Internet

    Informations forums :
    Inscription : Juin 2002
    Messages : 2 112
    Points : 4 240
    Points
    4 240
    Par défaut
    L'erreur a t-elle changée ? Si oui, il serait bon de la reposter ici.
    Peut nous également préciser la ligne de code qui se situe à l'endroit de ton erreur.
    Si vous jugez mon post utile dans la résolution de votre problème, n'hésitez pas à utiliser le système de vote afin d'améliorer la qualité du forum

  12. #12
    Membre à l'essai
    Profil pro
    Inscrit en
    Avril 2010
    Messages
    24
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2010
    Messages : 24
    Points : 11
    Points
    11
    Par défaut
    Voilà le LogCat :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    04-22 09:07:51.605: DEBUG/LocationManager(1750): Constructor: service = android.location.ILocationManager$Stub$Proxy@437483c8
    04-22 09:07:51.627: DEBUG/GpsLocationProvider(577): setMinTime 0
    04-22 09:07:51.675: DEBUG/AndroidRuntime(1750): Shutting down VM
    04-22 09:07:51.685: WARN/dalvikvm(1750): threadid=3: thread exiting with uncaught exception (group=0x4000fe70)
    04-22 09:07:51.697: ERROR/AndroidRuntime(1750): Uncaught handler: thread main exiting due to uncaught exception
    04-22 09:07:51.747: ERROR/AndroidRuntime(1750): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.LocProMobile.android/com.LocProMobile.android.VegaLyon}: java.lang.NullPointerException
    04-22 09:07:51.747: ERROR/AndroidRuntime(1750):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)
    04-22 09:07:51.747: ERROR/AndroidRuntime(1750):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)
    04-22 09:07:51.747: ERROR/AndroidRuntime(1750):     at android.app.ActivityThread.access$1800(ActivityThread.java:112)
    04-22 09:07:51.747: ERROR/AndroidRuntime(1750):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
    04-22 09:07:51.747: ERROR/AndroidRuntime(1750):     at android.os.Handler.dispatchMessage(Handler.java:99)
    04-22 09:07:51.747: ERROR/AndroidRuntime(1750):     at android.os.Looper.loop(Looper.java:123)
    04-22 09:07:51.747: ERROR/AndroidRuntime(1750):     at android.app.ActivityThread.main(ActivityThread.java:3948)
    04-22 09:07:51.747: ERROR/AndroidRuntime(1750):     at java.lang.reflect.Method.invokeNative(Native Method)
    04-22 09:07:51.747: ERROR/AndroidRuntime(1750):     at java.lang.reflect.Method.invoke(Method.java:521)
    04-22 09:07:51.747: ERROR/AndroidRuntime(1750):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
    04-22 09:07:51.747: ERROR/AndroidRuntime(1750):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
    04-22 09:07:51.747: ERROR/AndroidRuntime(1750):     at dalvik.system.NativeStart.main(Native Method)
    04-22 09:07:51.747: ERROR/AndroidRuntime(1750): Caused by: java.lang.NullPointerException
    04-22 09:07:51.747: ERROR/AndroidRuntime(1750):     at com.LocProMobile.android.TabWidget.tabVille(TabWidget.java:72)
    04-22 09:07:51.747: ERROR/AndroidRuntime(1750):     at com.LocProMobile.android.VegaLyon.WriteSettings(VegaLyon.java:242)
    04-22 09:07:51.747: ERROR/AndroidRuntime(1750):     at com.LocProMobile.android.VegaLyon$4.onRatingChanged(VegaLyon.java:120)
    04-22 09:07:51.747: ERROR/AndroidRuntime(1750):     at android.widget.RatingBar.dispatchRatingChange(RatingBar.java:308)
    04-22 09:07:51.747: ERROR/AndroidRuntime(1750):     at android.widget.RatingBar.onProgressRefresh(RatingBar.java:252)
    04-22 09:07:51.747: ERROR/AndroidRuntime(1750):     at android.widget.ProgressBar.doRefreshProgress(ProgressBar.java:492)
    04-22 09:07:51.747: ERROR/AndroidRuntime(1750):     at android.widget.ProgressBar.refreshProgress(ProgressBar.java:501)
    04-22 09:07:51.747: ERROR/AndroidRuntime(1750):     at android.widget.ProgressBar.setProgress(ProgressBar.java:550)
    04-22 09:07:51.747: ERROR/AndroidRuntime(1750):     at android.widget.ProgressBar.setProgress(ProgressBar.java:531)
    04-22 09:07:51.747: ERROR/AndroidRuntime(1750):     at android.widget.RatingBar.setRating(RatingBar.java:188)
    04-22 09:07:51.747: ERROR/AndroidRuntime(1750):     at com.LocProMobile.android.VegaLyon.onCreate(VegaLyon.java:144)
    04-22 09:07:51.747: ERROR/AndroidRuntime(1750):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
    04-22 09:07:51.747: ERROR/AndroidRuntime(1750):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)
    04-22 09:07:51.747: ERROR/AndroidRuntime(1750):     ... 11 more
    04-22 09:07:51.776: INFO/Process(577): Sending signal. PID: 1750 SIG: 3
    04-22 09:07:51.789: INFO/dalvikvm(1750): threadid=7: reacting to signal 3
    04-22 09:07:51.906: INFO/dalvikvm(1750): Wrote stack trace to '/data/anr/traces.txt'
    04-22 09:08:00.418: WARN/ActivityManager(577): Launch timeout has expired, giving up wake lock!
    04-22 09:08:01.087: WARN/ActivityManager(577): Activity idle timeout for HistoryRecord{43697f18 {com.LocProMobile.android/com.LocProMobile.android.VegaLyon}}

    Il semble que l'erreur soit identique...
    J'ai pourtant instancier TabWidget avec le code :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    tabwidget = new TabWidget();
    Merci pour votre aide

  13. #13
    Rédacteur
    Avatar de MrDuChnok
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Juin 2002
    Messages
    2 112
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Produits et services télécom et Internet

    Informations forums :
    Inscription : Juin 2002
    Messages : 2 112
    Points : 4 240
    Points
    4 240
    Par défaut
    Essaye de remplacer ta méthode pour mémoriser les villes par ceci :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
     
    //Liste contenant les villes
    private ArrayList<String> mListVille = new ArrayList<String>();
     
    //Ajout d'une ville
    public ArrayList<String> tabVille(String nomVille){
       mListVille.add(nomVille);
       Toast.makeText(this, "tabVille OK", 1000).show();
       return mListVille;
    }
    Ton code sera déjà plus évolutif et moins sujets aux erreurs (nullpointerException, indexoutofbound, etc).
    Si vous jugez mon post utile dans la résolution de votre problème, n'hésitez pas à utiliser le système de vote afin d'améliorer la qualité du forum

  14. #14
    Membre à l'essai
    Profil pro
    Inscrit en
    Avril 2010
    Messages
    24
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2010
    Messages : 24
    Points : 11
    Points
    11
    Par défaut
    Je test ça et j'edit.
    Merci beaucoup

    edit :

    Toujours le même problème. Voici le LogCat :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    04-22 09:43:26.166: WARN/dalvikvm(871): threadid=3: thread exiting with uncaught exception (group=0x4000fe70)
    04-22 09:43:26.188: ERROR/AndroidRuntime(871): Uncaught handler: thread main exiting due to uncaught exception
    04-22 09:43:26.223: ERROR/AndroidRuntime(871): java.lang.NullPointerException
    04-22 09:43:26.223: ERROR/AndroidRuntime(871):     at android.content.ContextWrapper.getResources(ContextWrapper.java:79)
    04-22 09:43:26.223: ERROR/AndroidRuntime(871):     at android.widget.Toast.<init>(Toast.java:88)
    04-22 09:43:26.223: ERROR/AndroidRuntime(871):     at android.widget.Toast.makeText(Toast.java:230)
    04-22 09:43:26.223: ERROR/AndroidRuntime(871):     at com.LocProMobile.android.TabWidget.tabVille(TabWidget.java:77)
    04-22 09:43:26.223: ERROR/AndroidRuntime(871):     at com.LocProMobile.android.VegaLyon.WriteSettings(VegaLyon.java:241)
    04-22 09:43:26.223: ERROR/AndroidRuntime(871):     at com.LocProMobile.android.VegaLyon$4.onRatingChanged(VegaLyon.java:120)
    04-22 09:43:26.223: ERROR/AndroidRuntime(871):     at android.widget.RatingBar.dispatchRatingChange(RatingBar.java:308)
    04-22 09:43:26.223: ERROR/AndroidRuntime(871):     at android.widget.RatingBar.onStopTrackingTouch(RatingBar.java:296)
    04-22 09:43:26.223: ERROR/AndroidRuntime(871):     at android.widget.AbsSeekBar.onTouchEvent(AbsSeekBar.java:294)
    04-22 09:43:26.223: ERROR/AndroidRuntime(871):     at android.view.View.dispatchTouchEvent(View.java:3368)
    04-22 09:43:26.223: ERROR/AndroidRuntime(871):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
    04-22 09:43:26.223: ERROR/AndroidRuntime(871):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
    04-22 09:43:26.223: ERROR/AndroidRuntime(871):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
    04-22 09:43:26.223: ERROR/AndroidRuntime(871):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1707)
    04-22 09:43:26.223: ERROR/AndroidRuntime(871):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1197)
    04-22 09:43:26.223: ERROR/AndroidRuntime(871):     at android.app.Activity.dispatchTouchEvent(Activity.java:1993)
    04-22 09:43:26.223: ERROR/AndroidRuntime(871):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1691)
    04-22 09:43:26.223: ERROR/AndroidRuntime(871):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1525)
    04-22 09:43:26.223: ERROR/AndroidRuntime(871):     at android.os.Handler.dispatchMessage(Handler.java:99)
    04-22 09:43:26.223: ERROR/AndroidRuntime(871):     at android.os.Looper.loop(Looper.java:123)
    04-22 09:43:26.223: ERROR/AndroidRuntime(871):     at android.app.ActivityThread.main(ActivityThread.java:3948)
    04-22 09:43:26.223: ERROR/AndroidRuntime(871):     at java.lang.reflect.Method.invokeNative(Native Method)
    04-22 09:43:26.223: ERROR/AndroidRuntime(871):     at java.lang.reflect.Method.invoke(Method.java:521)
    04-22 09:43:26.223: ERROR/AndroidRuntime(871):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
    04-22 09:43:26.223: ERROR/AndroidRuntime(871):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
    04-22 09:43:26.223: ERROR/AndroidRuntime(871):     at dalvik.system.NativeStart.main(Native Method)
    04-22 09:43:26.265: INFO/Process(584): Sending signal. PID: 871 SIG: 3
    04-22 09:43:26.265: INFO/dalvikvm(871): threadid=7: reacting to signal 3
    04-22 09:43:26.344: INFO/dalvikvm(871): Wrote stack trace to '/data/anr/traces.txt'
    04-22 09:43:27.254: DEBUG/dalvikvm(626): GC freed 144 objects / 6816 bytes in 185ms
    Encore merci pour ton aide !

  15. #15
    Rédacteur
    Avatar de MrDuChnok
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Juin 2002
    Messages
    2 112
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Produits et services télécom et Internet

    Informations forums :
    Inscription : Juin 2002
    Messages : 2 112
    Points : 4 240
    Points
    4 240
    Par défaut
    Enlève le Toast dans la méthode d'ajout de ville.
    J'imagine que ton activity n'a pas de contexte bien géré, du coup le Toast ne peut pas bien s'afficher.
    Si vous jugez mon post utile dans la résolution de votre problème, n'hésitez pas à utiliser le système de vote afin d'améliorer la qualité du forum

  16. #16
    Membre à l'essai
    Profil pro
    Inscrit en
    Avril 2010
    Messages
    24
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2010
    Messages : 24
    Points : 11
    Points
    11
    Par défaut
    Ca marche !!!

    Le problème venait donc que du Toast !

    Merci beaucoup pour ton aide.

    Bonne continuation

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Poker - Problème Algo
    Par xinu1.1 dans le forum Langage
    Réponses: 9
    Dernier message: 17/06/2009, 16h54
  2. Problème algo [calcul de moyenne]
    Par Nathan66 dans le forum Algorithmes et structures de données
    Réponses: 2
    Dernier message: 05/10/2008, 08h15
  3. [Tableaux] Problème algo récursif
    Par Invité dans le forum Langage
    Réponses: 38
    Dernier message: 03/10/2006, 15h49
  4. problème algo
    Par petitgato dans le forum C
    Réponses: 1
    Dernier message: 17/03/2006, 12h32
  5. Problème algo de parcour de graphe
    Par goblin dans le forum Langage
    Réponses: 1
    Dernier message: 11/12/2005, 15h04

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo