Path: csiph.com!aioe.org!.POSTED!not-for-mail From: Filippo Newsgroups: it.comp.java Subject: gestione eccezioni Date: Thu, 27 Oct 2016 19:17:04 +0200 Organization: Aioe.org NNTP Server Lines: 34 Message-ID: NNTP-Posting-Host: f5Fmz9UskbeJ4K18NiTO/w.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 X-Notice: Filtered by postfilter v. 0.8.2 X-Mozilla-News-Host: news://news.aioe.org:119 Xref: csiph.com it.comp.java:8986 Alla ricerca del codice da correggere mi sono imbattuto in questa parte in cui dovrebbe verificare se si è in presenza di un tablet o no attraverso le istruzioni try/catch: public static boolean isTablet() { boolean bol1 = false; try { System.currentTimeMillis(); String str = Tablet.GetDeviceID(); System.currentTimeMillis(); if (str != null) { boolean bol2 = str.equalsIgnoreCase(""); if (!bol2) {} } else { bol1 = true; } return bol1; } catch (Exception localException) { localException.printStackTrace(); } return false; } Qualcuno potrebbe spiegarmi che operazioni fa? Cosa fa se str! è null? E che c'entra currenttimemillis con getdeviceid? Grazie