Horizontal RadioGroup

by kaloer » Mon, 13 Apr 2009 12:14:20 GMT

Sponsored Links
I'm new to Android Developing, and don't know how to list the
RadioButtons in a RadioGroup horizontal instead of the default
vertical way.

Default it is like this:
(o) XX
(o) XX
(o) XX

How can i do this:
(o) X (o) X (o) X

I am doing the layout in code, so please answer using that instead of
xml :-)

Best Regards


Horizontal RadioGroup

by Ralf » Mon, 13 Apr 2009 13:49:55 GMT

 RadioGroup inherits from LinearLayout, so you should be able to simply
use android:orientation="horizontal" in your XML or the corresponding
java code (disclaimer: I've never tried to do so, but it seems



Sponsored Links

Horizontal RadioGroup

by kaloer » Mon, 13 Apr 2009 15:33:19 GMT

 Thank you,
I already had tried the getOrientation method, but did not know how to
use it. But i found out, that you simply write getOrientation(0) for
horizontal and getOrientation(1) for vertical :-)


Other Threads

1. How to enable search functionality to EditText

Hi friends,

I would like to enable search functionality to EditText.

my requirement is like this:
when some one types with some letter, suppose the user types 'a', then
it should show all the words which starts with 'a' should be shown as
a drop down list.

For example, if I first typed "copy" in the EditText, if again, I
cleared the EditText and tried to type "co", then it should show the
drop-down list "copy","come","cow"....

I want to enable this feature to my EditText view.

Can any one please suggest me how to do this?


2. Implimenting Buttons

Hey guys, I know that this is most likely the most n00bish question
asked in this group, but I'm pulling my hair out here.  I am currently
enrolled in Software Engineering at University and have just finished
a module on Java programming , so Java isn't new to me.  But for the
life of me, I just cannot impliment buttons into my app.  What I need
to do is to have 3 buttons, each calling the same method but passing a
different parameter into the method.  I have tried various methods
such as:

public void onCreate(Bundle savedInstanceState) {

                // Capture our button from layout
                Button button = (Button) findViewById(R.id.button1);
                // Register the onClick listener with the implementation above

private OnClickListener mCorkyListener = new OnClickListener() {
                public void onClick(View v) {
                        if (v.getId() == R.id.button) {
                            } else {
                        Log.d("DEBUGTAG", "onClick called");

And each time it force closes, the LogCat states that it is due to

If anyone could help, I would be very grateful.

Thank you in advance.


3. How get horizontal and vertical events in android

4. Android INIT not loading firmware

5. How to manage Delay in InputStream ?

6. UK Developers

7. Store completely open?