fifix Posted May 6, 2011 Share Posted May 6, 2011 Bonjour, Alors voilà je cherche comment faire un try catch qui fonctionne pour toutes les erreurs possibles. En gros je veux que si le programme plante alors il fasse le catch, sans faire planter l'activity, mais quelque soit l'erreur qui est survenu pendant le script. Est ce que c'est possible? Link to comment Share on other sites More sharing options...
nbatteur Posted May 7, 2011 Share Posted May 7, 2011 try{ //ton code }catch(Exception e){ //code a executer en cas d'erreur } Link to comment Share on other sites More sharing options...
Alocaly Posted May 8, 2011 Share Posted May 8, 2011 Il y a un handler d'erreur général pour ton application, si tu veux. je te conseille hautement de regarder la lib Acra sur google Code, faite par un programmeur d'ici ( et avec ma modeste contribution ), tu trouveras comment t'en servir. Emmanuel / Alocaly Link to comment Share on other sites More sharing options...
fifix Posted May 8, 2011 Author Share Posted May 8, 2011 Salut à vous, Je vais regarder ceci. J'ai en partie résolu mon problème sauf que quelques fois j'ai des erreurs et de handler comme tu le dit alocaly. Je vais regarde ta librairie Acra. Merci Link to comment Share on other sites More sharing options...
Mc Flurry Posted May 9, 2011 Share Posted May 9, 2011 Je completerai nbatteur avec ceci : try{ //ton code }catch(Exception e){ e.printStackTrace(); //Permet d'afficher toute les infos de ton exception, type, endroit, ... //code a executer en cas d'erreur } Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.