Screen size problem
<p>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..</p>

<p>code for xml...</p>

<pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;

&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"&gt;
        &lt;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"&gt;
            &lt;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"&gt;
            &lt;/Button&gt;
            &lt;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"&gt;
            &lt;/TextView&gt;
            &lt;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"&gt;
            &lt;/TextView&gt; 
            &lt;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"&gt;
            &lt;/Button&gt;   
    &lt;/LinearLayout&gt; 

    &lt;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"&gt;            
    &lt;/LinearLayout&gt;   

    &lt;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"&gt;
            &lt;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"&gt;
            &lt;/TextView&gt; 
            &lt;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"&gt;
            &lt;/TextView&gt; 
            &lt;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"&gt;
            &lt;/TextView&gt; 
    &lt;/LinearLayout&gt;

&lt;/RelativeLayout&gt;
</code></pre>

<p>code for java......</p>

<pre><code>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&lt;6; i++)
{
    rowLayout = new LinearLayout(this);

    rowLayout.setWeightSum(7);

    layoutVertical.addView(rowLayout,param);

    for(j=0;j&lt;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;                    
</code></pre>

<p>}</p>

<p>snapshot which for device having resolution 240 X 400</p>

<p><img src="http://i.stack.imgur.com/E0DF2.png" alt="enter image description here"></p>

<p>Snapshot for device having resolution 240 X 320 is...</p>

<p><img src="http://i.stack.imgur.com/ZqlGA.png" alt="enter image description here"></p>

<p>so by seeing this you know the problem...please suggest me..</p>
