Drawable issues

by Ashwini » Thu, 22 Apr 2010 03:12:00 GMT

Sponsored Links

I am trying to resize an image in a textview (set using imagespan). I
tried using setbounds but the image is not reflected.

OnPreDraw - set the bounds
OnDraw - shows the image in some weird place - the updated position
isn't shown correctly.

Can someone please suggest any other option to resize a drawable ?


Other Threads

1. WebView History use?

I'm working on a custom html browser using WebView.loadData().  I'm
trying to implement a back button feature, but it seems that loadData
doesn't update the history, and I have no way to do it myself.

private WebView wv;
private boolean goBack = false;

public void onCreate(Bundle icicle)
  wv = (WebView)findViewById(R.id.record_html);

  wv.loadData("<html><body>Test!</body></html>", "text/html",

boolean onKey(View v, int keyCode, KeyEvent event)
  if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() ==
    if (goBack)
      if (wv.canGoBack())
        goBack = !goBack;
        return true;
      goBack = !goBack;
      wv.loadData("<html><body>Test 2!</body></html>","text/html",
      return true;
  return false;

I would expect this to first load "Test!".  When I press the back
button, it loads "Test2!" (this part works), and sets goBack to true.
Then I press the back button again, and it sees that it can goBack,
and loads "Test!" again.  Instead, canGoBack() returns false.

I've tried adding a WebViewClient and calling doUpdateVisitedHistory,
but that is asking for a URL and doesn't accept data.

Is there another way of doing this, or am I going to have to create a
list of HTML to cycle through?

2. SDK Bug - ViewAnimator Crash


I've noticed that the ViewAnimator class will often crash with the

"Application Error:

An error has occured in [application]. width and height must be > 0."

I am fairly confident this is a problem with the SDK.  It appears to
me that the problem is easier to reproduce under load, which is
similar to this person's findings:

3. Monitor live objects in android app !!!

4. Display Context menu

5. MapActivity onTouchEvent

6. Line separator (between views/controls on activity page)

7. ListView - make no item focused on startup?