How to put Margin for widgets

by Nithin » Thu, 19 Nov 2009 13:42:49 GMT

Sponsored Links
 ny idea, how to put margin for widgets...

setPadding() wont work in my case. I want the entire widget to move,
unlike setPadding. In setPadding(), only contents will move within the


On Nov 18, 3:26pm, Nithin <> wrote:


How to put Margin for widgets

by Nithin » Thu, 19 Nov 2009 14:54:24 GMT


I dont know, what I did till now, now all working fine..

I got the input from this link

the code I am working is,

layout = new LinearLayout(this);
layoutParams = new LinearLayout.LayoutParams(
layoutParams.setMargins(30, 10, 0, 0);
TextView tv = new TextView(this);
tv.setText("Sample text");
layout.addView(tv, layoutParams);


On Nov 19, 10:42am, Nithin <> wrote:


Sponsored Links

Other Threads

1. API to disable/enable data connections

Hi all,

I'm looking for an API to disable/enable data connections(GPRS,EGDE
It appears that there is none to be found.
(in the 0.9 version there was something called setRadio but now it is

Do you know whether things get better in eclair?

I intend to look at the configuration app source code for cupcake.
Did someone try that?

I would be happy to hear from the google guys about their decision.
What are the chances for it to change in the future?

Thanks in advance,
Brownie (one day, my nick will collide with an android version :))


2. Getting notified of installs

Any more info on this?



3. How to add a dialog in a AppWidget

4. Android WVGA support

5. question on media.audio_policy

6. Trap in TabHost when AsyncTask delays setContentView at activity startup

7. How to Help on traduction?