예제 #1
0
  /**
   * Called by Android when we're bound to the custom view. Allows us to set the custom properties
   * of our custom view elements as we desire (We can now use findViewById on them).
   *
   * @param view The view instance for this Preference object.
   */
  @Override
  protected void onBindView(View view) {
    super.onBindView(view);

    // We synchronise to avoid a race condition between this and the favicon loading callback in
    // setSearchEngineFromBundle.
    synchronized (bitmapLock) {
      // Set the icon in the FaviconView.
      mFaviconView = ((FaviconView) view.findViewById(R.id.search_engine_icon));

      if (mIconBitmap != null) {
        mFaviconView.updateAndScaleImage(IconResponse.create(mIconBitmap));
      }
    }
  }