These code examples were ranked by Codota’s semantic indexing as the best open source examples for Log e method.
Log.e(TAG, e.getMessage(), e); } @Override public void onMalformedURLException(MalformedURLException e, final Object state) { Log.e(TAG, e.getMessage(), e); } }
Uri uri = Uri.parse(niceUrl); InputStream stream = assets.open(uri.getPath(), AssetManager.ACCESS_STREAMING); WebResourceResponse response = new WebResourceResponse(mimetype, "UTF-8", stream); return response; } catch (IOException e) { LOG.e("generateWebResourceResponse", e.getMessage(), e); } } return null; } }
FacebookEvents.onPostPublishingFailed(); } @Override public void onMalformedURLException(MalformedURLException e, final Object state) { Log.e(TAG, e.getMessage(), e); FacebookEvents.onPostPublishingFailed(); } }
JSONObject obj = new JSONObject(); try { obj.put("level", batteryIntent.getIntExtra(android.os.BatteryManager.EXTRA_LEVEL, 0)); obj.put("isPlugged", batteryIntent.getIntExtra(android.os.BatteryManager.EXTRA_PLUGGED, -1) > 0 ? true : false); } catch (JSONException e) { Log.e(LOG_TAG, e.getMessage(), e); } return obj; } /** * Updates the JavaScript side whenever the battery changes * * @param batteryIntent the current battery information * @return */ private void updateBatteryInfo(Intent batteryIntent) { sendUpdate(this.getBatteryInfo(batteryIntent), true); }
throw new DataException(e); } catch (SAXException e) { Log.e(TAG, "SAXException", e); throw new DataException(e); } catch (IOException e) { Log.e(TAG, "IOException", e); throw new DataException(e); } return parser.mPersonList; } private static class PersonHandler extends DefaultHandler { private StringBuilder mSb = new StringBuilder(); public ArrayList<Person> mPersonList = new ArrayList<Person>(); public Person mCurrentPerson = null; @Override public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
AssetManager assetManager = context.getAssets(); InputStream inputStream = null; try { inputStream = assetManager.open(filename); } catch (IOException e) { Log.e(TAG, e.getLocalizedMessage(), e); } return inputStream; } }
// Forbidden being instantiated. } // FIXME: need to optimize this method. private static boolean isLowMemory(SQLiteException e) { return e.getMessage().equals(SQLITE_EXCEPTION_DETAIL_MESSAGE); } public static void checkSQLiteException(Context context, SQLiteException e) { if (isLowMemory(e)) { Toast.makeText(context, "Low Memory", Toast.LENGTH_SHORT).show(); } else { throw e; } } public static Cursor query(Context context, ContentResolver resolver, Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) { try {
doc = builder.parse(inputstream); inputstream.close(); } catch(ParserConfigurationException e) { Log.e(Tag, e.toString(), e); e.printStackTrace(); } catch(IllegalStateException e) { Log.e(Tag, e.toString(), e); e.printStackTrace(); } catch(IOException e) { Log.e(Tag, e.toString(), e); e.printStackTrace(); } catch(SAXException e) { Log.e(Tag, e.toString(), e); e.printStackTrace(); }
this.prepareClient(); } catch (KeyManagementException e) { Log.e(LOG_TAG, "Couldn't prepare client.", e); delegate.handleTransportException(e); } catch (NoSuchAlgorithmException e) { Log.e(LOG_TAG, "Couldn't prepare client.", e); delegate.handleTransportException(e); } this.execute(); } @Override public void get() { Log.i(LOG_TAG, "HTTP GET " + this.uri.toASCIIString()); this.go(new HttpGet(this.uri)); } @Override public void delete() { Log.i(LOG_TAG, "HTTP DELETE " + this.uri.toASCIIString());
m.obj = e.toString(); Log.e(TAG, "Exception on opening Input Stream", e); } catch (ParserConfigurationException e) { m.obj = e.toString(); Log.e(TAG, "Exception on parsing XML File", e); } catch (SAXException e) { m.obj = e.toString(); Log.e(TAG, "Exception while creating SAXParser", e); } ThemeListActivity.FeaturedThemesProgressHandler.sendMessage(m); } }
31:
32: } else {
33: Log.e("Compass MainActivity", "Registerered for ORIENTATION Sensor");
34: Toast.makeText(this, "ORIENTATION Sensor not found",
35: Toast.LENGTH_LONG).show();
41: audiofile = File.createTempFile("sound", ".3gp", sampleDir);
42: } catch (IOException e) {
43: Log.e(TAG, "sdcard access error");
44: return;
45: }
5: throw new RuntimeException("File not found");
6: }
7: Log.e("Testing", "Starting to read");
8: BufferedReader reader = null;
9: try {
57: .getJSONFromUrl("http://api.androidhive.info/game/game_stats.json");
58:
59: Log.e("Response: ", "> " + json);
60:
61: if (json != null) {
-
66: earned = jObj.getString("earned");
67:
68: Log.e("JSON", "> " + now_playing + earned);
69:
70: } catch (JSONException e) {
180: return rss_url;
181: }
182:
183: /**
184: * Method to get xml content from url HTTP Get request
-
183: /**
184: * Method to get xml content from url HTTP Get request
185: * */
186: public String getXmlFromUrl(String url) {
187: String xml = null;
-
186: public String getXmlFromUrl(String url) {
187: String xml = null;
188:
189: try {
190: // request method is GET
198: } else {
199: // error in creating fragment
200: Log.e("MainActivity", "Error in creating fragment");
201: }
202: }