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. Launching App from a browser


I am desperately trying to launch android app from a browser via a
link in a page.
I tried all the options using Intent Filters but none of them seemed
to work.

Please point to an example



2. Problems with Accelerometer - random values

Hello all,

I'm using a HTC Magic in order to develop an application which makes
use of the accelerometer. Following the indications from tutorials and
the docs, this is a snapshot of the code I'm using:

/* Next code register the ACCELEROMETER SENSOR*/
  SensorManager mSensorManager = (SensorManager) getSystemService

  List<Sensor> listSensors = mSensorManager.getSensorList
  Sensor acelerometerSensor = listSensors.get(0);
  mSensorManager.registerListener(this, acelerometerSensor,

/*OnSensorChanged Method, here I receive the wrong values*/
public void onSensorChanged(SensorEvent event) {
                // TODO Auto-generated method stub
                synchronized (this) {
                          switch(event.sensor.getType()) {
                                    case Sensor.TYPE_ACCELEROMETER:
                                           for (int i=0 ; i<3 ; i++) {
                                                  mAccelerometerValues[i] =
                         if ( mAccelerometerValues[0]  >= 1)
                                  //selectAndChange() send some HTTP
Petitions and updates the screen
                                 selectAndChange(0, null,"",3);
                         else if ( mAccelerometerValues[0]  <= -1)




I'm nevermind getting values that don't match with the accelerometer.
With the phone standing over my table, with no movement, I get values


And sometimes the expected value:

I guess my SensorManager is kind of mixing all the other sensors, but
I do not guess where the problem could be. I have been checking other
codes, and in all of them the estructure is aproximately the same.

Any clues of what could I try?

Thank you


3. Tasks Running in Android

4. retreive data from servlet

5. Learning Android Development

6. question about intents

7. Debugging in to android SDK code, or some other way of determining why it crashed