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 6194293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:16:21+00:00 2026-05-24T03:16:21+00:00

In my app which create an calendar using buttons..its working fine in all resolution

  • 0

In my app which create an calendar using buttons..its working fine in all resolution except device with screen resolution 240X320..Actually it runs but some part is not visible..i have send the code and the screen shot..please anyone help me to resolve this problem..

code for xml…

    <?xml version="1.0" encoding="UTF-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
        <LinearLayout android:id="@+id/linearLayout" 
            android:gravity="center_horizontal|center_vertical"
            android:orientation="horizontal"
            android:layout_marginLeft="30dp"
            android:layout_marginRight="30dp"
            android:layout_marginTop="20dp"
            android:layout_height="wrap_content" 
            android:layout_width="fill_parent"     
            android:background="#00000000">
            <Button 
            android:id="@+id/pBtnPrevMonth" 
            android:gravity="center_horizontal|center_vertical"
            android:layout_width="53dp" 
            android:layout_height="40dp"
            android:textColor="#000000"
            android:background="@drawable/but_left">
            </Button>
            <TextView 
            android:gravity="center_horizontal|center_vertical"
            android:id="@+id/tTextMonth"        
            android:layout_width="50dp" 
            android:layout_height="wrap_content"
            android:layout_toRightOf="@+id/pBtnPrevMonth"
            android:textColor="#000000">
            </TextView>
            <TextView 
            android:gravity="center_horizontal|center_vertical"
            android:id="@+id/tTextYear" 
            android:layout_width="50dp" 
            android:layout_marginRight="5dp"
            android:layout_height="wrap_content"
            android:layout_toRightOf="@+id/tTextMonth"
            android:textColor="#000000">
            </TextView> 
            <Button 
            android:id="@+id/pBtnNextMonth" 
            android:gravity="center_horizontal|center_vertical"
            android:layout_width="53dp" 
            android:layout_height="40dp"
            android:layout_toRightOf="@+id/tTextYear"
            android:textColor="#000000"
            android:background="@drawable/but_right">
            </Button>   
    </LinearLayout> 

    <LinearLayout   
            android:id="@+id/liVLayout"
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/linearLayout"
            android:layout_marginTop="15dp">            
    </LinearLayout>   

    <LinearLayout android:id="@+id/linearLayout1" 
            android:gravity="center_horizontal|center_vertical"
            android:orientation="vertical"  
            android:layout_marginLeft="7dp"
            android:layout_marginRight="7dp"    
            android:layout_below="@+id/liVLayout"
            android:layout_height="wrap_content" 
            android:layout_width="fill_parent"     
            android:background="#00000000">
            <TextView 
            android:gravity="center_vertical"
            android:text="Hello"
            android:layout_marginTop="5dp"
            android:id="@+id/txtView" 
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content"
            android:textColor="#000000">
            </TextView> 
            <TextView 
            android:gravity="center_vertical"
            android:id="@+id/txtNoteView" 
            android:layout_marginTop="5dp"
            android:layout_below="@+id/txtView" 
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content"
            android:textColor="#000000">
            </TextView> 
            <TextView 
            android:gravity="center_horizontal|center_vertical"
            android:text="Advertisement"
            android:layout_marginTop="5dp"
            android:id="@+id/txtAdvView" 
            android:layout_below="@+id/txtNoteView" 
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content"
            android:textColor="#000000">
            </TextView> 
    </LinearLayout>

</RelativeLayout>

code for java……

public void onCreate(Bundle savedInstanceState){
            super.onCreate(savedInstanceState); 
            setContentView(R.layout.calendar_frm); 

        txtView=(TextView) findViewById(R.id.txtView);

            txtNoteView=(TextView) findViewById(R.id.txtNoteView);

            txtAdvView=(TextView) findViewById(R.id.txtAdvView);
}

public boolean initDay()
{
  LinearLayout layoutVertical = (LinearLayout) findViewById(R.id.liVLayout);
   LinearLayout rowLayout=null;

LayoutParams param = new      LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT,1);

//Create Button
for (i = 0; i<6; i++)
{
    rowLayout = new LinearLayout(this);

    rowLayout.setWeightSum(7);

    layoutVertical.addView(rowLayout,param);

    for(j=0;j<7;j++)
    {

           pBtnDay[i][j]=new Button(this);

           rowLayout.addView(pBtnDay[i][j],param); 

           pBtnDay[i][j].setGravity(Gravity.CENTER_HORIZONTAL|Gravity.CENTER_VERTICAL);

    }
}               
return true;                    

}

snapshot which for device having resolution 240 X 400

enter image description here

Snapshot for device having resolution 240 X 320 is…

enter image description here

so by seeing this you know the problem…please suggest me..

  • 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-05-24T03:16:21+00:00Added an answer on May 24, 2026 at 3:16 am

    create another xml layout file for this resolution with smaller icons or suchlike

    “By default, Android resizes your application layout to fit the current device screen. In most cases, this works fine. In other cases, your UI might not look as good and might need adjustments for different screen sizes. For example, on a larger screen, you might want to adjust the position and size of some elements to take advantage of the additional screen space, or on a smaller screen, you might need to adjust sizes so that everything can fit on the screen.

    The configuration qualifiers you can use to provide size-specific resources are small, normal, large, and xlarge. For example, layouts for an extra large screen should go in layout-xlarge/.
    “

    http://developer.android.com/guide/practices/screens_support.html#support

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web app which connects to a server using a TCP connection
I have an MFC app which I have been working on for a few
I have a WPF app which snaps to screen edges (I just set the
I work on a app which has only one way to get a working
I m Using a calendar.js file to implement calendar in my App. Actually this
I'm new to Xcode and I'm trying to create an app which has a
I'm working on a phonegap iPhone app which downloads content from the network in
I have a web app which I can create some notes, each time I
I want to create an app which would monitor changes to data in a
I want to create a native app/web app which works on iPhone, iPad. I

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.