These code examples were ranked by Codota’s semantic indexing as the best open source examples for Log v method.
Log.e(TAG, e.getMessage(), e); } @Override public void onMalformedURLException(MalformedURLException e, final Object state) { Log.e(TAG, e.getMessage(), e); } }
try { file = new RandomAccessFile(imagePath, "r"); return BitmapFactory.decodeFileDescriptor(file.getFD(), null, options); } catch (IOException e) { Log.d(TAG, e.getMessage(), e); return null; } finally { if (file != null) try { file.close(); } catch (IOException e) { Log.d(TAG, e.getMessage(), e); } } } /** * Get a bitmap from the image *
FacebookEvents.onPostPublishingFailed(); } @Override public void onMalformedURLException(MalformedURLException e, final Object state) { Log.e(TAG, e.getMessage(), e); FacebookEvents.onPostPublishingFailed(); } }
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 {
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); }
try { file = new RandomAccessFile(imagePath, "r"); return BitmapFactory.decodeFileDescriptor(file.getFD(), null, options); } catch (IOException e) { Log.d(TAG, e.getMessage(), e); return null; } finally { if (file != null) try { file.close(); } catch (IOException e) { Log.d(TAG, e.getMessage(), e); } } } /** * Get size of image *
// 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(); }
AssetManager assetManager = context.getAssets(); InputStream inputStream = null; try { inputStream = assetManager.open(filename); } catch (IOException e) { Log.e(TAG, e.getLocalizedMessage(), e); } return inputStream; } }
totalNumberOfFrame = mEndFrameNo - mStartFrameNo; avgFrameRate = getAverageFrameRate(totalNumberOfFrame, mDuration); writer.write(String.format("%s:%.2f\n",mTestCaseName,avgFrameRate)); writer.close(); } catch (IOException e) { Log.w(TAG, "Can't write sdcard log file", e); } finally { try { if (writer != null) writer.close(); } catch (IOException e) { Log.e(TAG, "IOException " + e.toString()); } } } // Parse the output of the surfaceFlinge shell command call private String getNumberOfFrames(String input){ String noOfFrames = null; Matcher m = NO_OF_FRAMES_PATTERN.matcher(input); if (m.matches()){
90: GCMRegistrar.setRegisteredOnServer(context, false);
91: String message = context.getString(R.string.server_unregistered);
92: CommonUtilities.displayMessage(context, message);
93: } catch (IOException e) {
94: // At this point the device is unregistered from GCM, but still