Drawable Setbounds not working

by Ashwini » Wed, 21 Apr 2010 20:25:57 GMT


Sponsored Links
 I am trying to scale a drawable at run time depending on the
orientation and and handset dimensions. But this does not seem to take
effect.

This is done on onPreDraw() of textview. It's a textview having text
and images.

Works fine on the 2.x handsets but does not work on the 1.6 ones.
Any ideas on how this can be resolved ?

--



Other Threads

1. TabHost and New Activities

Hello,

I've been trying to start new activities based on a TabHost using the
following code:
                setContentView(R.layout.main);

                TabHost tabs =
                (TabHost)this.findViewById(R.id.th_set_menu_tabhost);
                            tabs.setup();

                            TabSpec ts1 = tabs.newTabSpec("Page 1");
                            ts1.setIndicator("p1");
                            ts1.setContent(R.id.Main);
                            tabs.addTab(ts1);

                            TabSpec ts2 = tabs.newTabSpec("Page 2");
                            ts2.setIndicator("p2");
                            ts2.setContent(new Intent(this,
NewActivity.class));
                            tabs.addTab(ts2);

But I keep getting the following error:
11-22 14:55:43.913: ERROR/AndroidRuntime(1231):
java.lang.IllegalStateException: Did you forget to call 'public void
setup(LocalActivityManager activityGroup)'?
11-22 14:55:43.913: ERROR/AndroidRuntime(1231):     at
android.widget.TabHost$IntentContentStrategy.getContentView
(TabHost.java:598)
11-22 14:55:43.913: ERROR/AndroidRuntime(1231):     at
android.widget.TabHost.setCurrentTab(TabHost.java:310)
11-22 14:55:43.913: ERROR/AndroidRuntime(1231):     at
android.widget.TabHost$2.onTabSelectionChanged(TabHost.java:126)

Any ideas on this? Thanks in advance!

--~--~---------~--~----~------------~-------~--~----~

2. PhoneStateListener GarbageCollection

I'm trying to figure out the best way to have a PhoneStateListener
survive as long as possible and be recreated if necessary.


                TelephonyManager telephonyManager = (TelephonyManager)
aContext.getSystemService(Context.TELEPHONY_SERVICE);
                telephonyManager.listen(listener,
PhoneStateListener.LISTEN_CALL_STATE); //

I'm setting that up on BOOT_COMPLETED, and it survives for a while,
but eventually garbage collection kicks in and seems to kill my
listener.

Setting a service up that just holds a reference would work right? But
what concerns do I need to have about services dieing?

Anyone have an idea why phone states weren't implemented as a
broadcast intent?
--~--~---------~--~----~------------~-------~--~----~

3. :: BackGround Service..!!Help

4. onContextItemSelected is never called

5. I broke my project

6. How can i get my location?? use GPS? And a new txt reader test!

7. receive permissions for xmpp client