tags:

views:

144

answers:

1

![alt text][1]Hi folks

i am using admob ads for my android applicaiton.in portrait mode it fixed top of the screen when i changed to landscape mode.that add disply size of the portrait mode add size

how i get fill parent in landscape mode

+import com.admob.android.ads.AdManager; import com.admob.android.ads.AdView; import android.app.Activity; import android.graphics.Color; import android.os.Bundle; import android.view.Window; import android.view.ViewGroup.LayoutParams; import android.widget.LinearLayout;

public class narasimha extends Activity   {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.main);
        AdView adView = new AdView(this);
        adView.setVisibility(AdView.VISIBLE);
        adView.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
        adView.setPrimaryTextColor(Color.BLACK);
        adView.setBackgroundColor(Color.WHITE);
        adView.setSecondaryTextColor(Color.LTGRAY);
        adView.setRequestInterval(20);
       AdManager.setTestDevices(new String[]{ AdManager.TEST_EMULATOR});
        ((LinearLayout)findViewById(R.id.ad)).addView(adView);

portrait mode [1]: [url=http://www.freeimagehosting.net/][img]http://www.freeimagehosting.net/uploads/afd7c173cb.png[/img][/url]

landscape mode [url=http://www.freeimagehosting.net/][img]http://www.freeimagehosting.net/uploads/1758519975.png[/img][/url]

how can resolve this problem

+1  A: 

I don't think that will work because I think the ads are a fixed size. So your best bet is to probably just center the view in the layout.

BrennaSoft
thanks for responding, but in some sample applications we are getting proper fetching in both the modes ie a sample application from andnav2 application ,some other thirdparty tools in advertisements where i am using admob if u have any idea about advertisements which u have ever came across this type of issue please forward me and also provide any advertisements sites which u r familar with
narasimha