Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8270953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:43:31+00:00 2026-06-08T06:43:31+00:00

I am working with home screen widget.I want the button on the far right

  • 0

I am working with home screen widget.I want the button on the far right (second button) to stay fixed against the right of the parent linearlayout.

here is the code

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout01"
android:layout_width="200dp"
android:layout_height="75dp"
android:background="@drawable/shape"
android:orientation="horizontal" >

<Button
    android:id="@+id/update"
    android:layout_width="30dp"
    android:layout_height="fill_parent"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    android:text="Update"
    android:textSize="3pt" />

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/LinearLayout01"
    android:layout_width="wrap_content"
    android:layout_height="fill_parent"
    android:background="@drawable/shape"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/ssid"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal"
        android:text="SSID"
        android:textColor="#333333"
        android:textSize="5pt"
        android:layout_weight="1" />

    <TextView
        android:id="@+id/wifiip"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal"
        android:text="IP address"
        android:textColor="#333333"
        android:textSize="5pt"
        android:layout_weight="1" />

    <TextView
        android:id="@+id/extip"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/ssid"
        android:text="WAN IP"
        android:textColor="#333333"
        android:textSize="5pt"
        android:layout_weight="1" />
</LinearLayout>

<Button
    android:id="@+id/config"
    android:layout_width="30dp"
    android:layout_height="fill_parent"
    android:layout_alignParentRight="true"
    android:text="Config"
    android:textSize="3pt" />

the vertical linear layout in the middle is pushing or pulling the button right or left depding on the width of the textviews. Where am i going wrong?

Here is the xml for the widget provider

<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider
xmlns:android="http://schemas.android.com/apk/res/android" 
android:minWidth="200dp"
android:minHeight="75dp"
android:initialLayout="@layout/widget"
android:updatePeriodMillis="180000"

 />
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T06:43:33+00:00Added an answer on June 8, 2026 at 6:43 am

    Add this to your LinearLayout:

    android:layout_width="0dip"
    android:layout_weight="1"
    

    That should do it. Let me know if that worked.

    Edit:

    Try this code:

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/LinearLayout01"
    android:layout_width="200dp"
    android:layout_height="75dp"
    android:background="@drawable/shape"
    android:orientation="horizontal" >
    
    <Button
        android:id="@+id/update"
        android:layout_width="30dp"
        android:layout_height="fill_parent"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:text="Update"
        android:textSize="3pt" />
    
    <LinearLayout
        android:id="@+id/LinearLayout01"
        android:layout_width="0dip"
        android:layout_weight="1"
        android:layout_height="fill_parent"
        android:background="@drawable/shape"
        android:orientation="vertical" >
    
        <TextView
            android:id="@+id/ssid"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center_horizontal"
            android:text="SSID"
            android:textColor="#333333"
            android:textSize="5pt"
            android:layout_weight="1" />
    
        <TextView
            android:id="@+id/wifiip"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center_horizontal"
            android:text="IP address"
            android:textColor="#333333"
            android:textSize="5pt"
            android:layout_weight="1" />
    
        <TextView
            android:id="@+id/extip"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/ssid"
            android:text="WAN IP"
            android:textColor="#333333"
            android:textSize="5pt"
            android:layout_weight="1" />
    </LinearLayout>
    
    <Button
        android:id="@+id/config"
        android:layout_width="30dp"
        android:layout_height="fill_parent"
        android:layout_alignParentRight="true"
        android:text="Config"
        android:textSize="3pt" />
    </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a home screen widget. I hope this widget can support
I'm working a personal project that's going to include a home-screen widget updated with
I want to come to home screen when clicking on the back button from
i am working on my App. in between i pressed the Home button on
Whenever I add an EditText widget to the layout of my home screen widget
I want to develop something like the home screen of the Android's devices, where
I am working on the home screen application, where I am trying to do
I have a button on my home screen that will add an edit text
I'm working on an Android widget which essentially places a button on the homescreen.
Hi guys I am working on an application.Where there is a home screen with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.