designMode in WebView

by Marc » Sat, 07 Mar 2009 02:26:14 GMT


Sponsored Links
 Somebody asked a while back, but got no reply...  Does anyone know if
designMode (or contentEditable) work in WebView (it seems not to)?  Is
this by design?   Coming soon?

TIA

Marc
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Overriding user sms request

Is it possible to know when a user tries to send an sms message, and
preventing him from doing so?

-- 

2. Memory Leaking problem

Hi,
I'm facing a serious Memory Leaking problem. The code below is a ImageAdapter 
for android.widget.Gallery.
After I rotate the screen for several times, the Application crashes and report 
a "out of memory error: bitmap size exceeds VM budget."
I wrote a finish() but it doesn't work either.
Really grateful to any suggestions.

Code:

public class ImageAdapter extends BaseAdapter {
 
 private Context mContext;
 private ImageView[] mImages;

 public ImageAdapter(Context context, Bitmap[] bitmaps) {
  if (mContext == null) {
   mContext = context;
  }
  if (mImages == null) {
   mImages = new ImageView[bitmaps.length];
  }
  createReflectedImages(bitmaps);
 }

 public ImageAdapter(Context context, int[] imageIds) {
  if (mContext == null) {
   mContext = context;
  }
  Bitmap[] bitmaps = new Bitmap[imageIds.length];
  if (mImages == null) {
   mImages = new ImageView[imageIds.length];
  }
  int i = 0;
  for (int imageId : imageIds) {
   bitmaps[i++] = BitmapFactory.decodeResource(
     mContext.getResources(), imageId);
  }
  createReflectedImages(bitmaps);
 }


 private boolean createReflectedImages(Bitmap[] mBitmaps) {
  // The gap we want between the reflection and the original image
  final int reflectionGap = 0;
  int index = 0;
  Bitmap reflectionImage = null;
  Bitmap bitmapWithReflection = null;
  BitmapDrawable bd;
  Paint paint = new Paint();
  for (Bitmap originalImage : mBitmaps) {
       int width = originalImage.getWidth();
       int height = originalImage.getHeight();
       Matrix matrix = new Matrix();
       matrix.preScale(1, -1);
   
       reflectionImage = Bitmap.createBitmap(originalImage, 0, height / 
2,width, height / 2, matrix, false);
       bitmapWithReflection = Bitmap.createBitmap(width,(height + height / 2), 
Config.ARGB_8888);
      
       Canvas canvas = new Canvas(bitmapWithReflection);
       canvas.drawBitmap(originalImage, 0, 0, null);
       
       paint.reset();
       canvas.drawRect(0, height, width, height + reflectionGap, paint);
       canvas.drawBitmap(reflectionImage, 0, height + reflectionGap, null);
      
       final LinearGradient shader = new LinearGradient(0, 
originalImage.getHeight(), 0,bitmapWithReflection.getHeight()+ reflectionGap, 
0x70ffffff, 0x00ffffff, TileMode.CLAMP);
     
       paint.setShader(shader);
       paint.setXfermode(new PorterDuffXfermode(Mode.DST_IN));
       canvas.drawRect(0, height, width, bitmapWithReflection.getHeight() + 
reflectionGap, paint);
  
       bd = new BitmapDrawable(bitmapWithReflection);
       bd.setAntiAlias(true);
       
       final ImageView imageView = new ImageView(mContext);
       imageView.setImageDrawable(bd);
       imageView.setLayoutParams(new GalleryFlow.LayoutParams(120, 120));
     
       mImages[index++] = imageView;
   
       originalImage.recycle();
  }
  
  reflectionImage.recycle();
 
  return true;
 }

 public int getCount() {
  return mImages.length;
 }
 public Object getItem(int position) {
  return position;
 }
 public long getItemId(int position) {
  return position;
 }

 public View getView(int position, View convertView, ViewGroup parent) {
    if (convertView == null) {
   convertView = mImages[position];
  }
  return convertView;
  }

 public void finish() {
 for (ImageView v : mImages) {
    v.setImageDrawable(null);
    v = null;
  }
  
 }
 }

2010-10-22



kearnel_android

-- 

3. How can I access data from SD card?

4. mediaplayer's onCompletionListener never called on playing 3gpp/amr audio files

5. Searchable dictionary results are not being shown in global search

6. One night with the gurus

7. Why doesn't AlarmManager allow querying or browsing of alarms or pending intents?