android - Trying to adapt my view to big and small screens through Scroll View -


This is my problem: I am trying to optimize my view for both large and small screens because the content is a Not fit into small screen, I thought about using Scroll View to fix it. It works like I work on a small screen, but every time I try to run it on a bigger screen, I get an error. My Layout Code:

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; android.support.v4.widget.DrawerLayout xmlns: android = "http://schemas.android.com/apk/res/android" android: id = "@ + id / drawer_layout" Android: layout_width = "match_parent" Android: Layout_height = "match_parent" android: padding = "5dp" android: background = "# ffffff" & gt; & Lt; FrameLayout Android: id = "@ + id / content_frame2" Android: layout_width = "match_parent" Android: layout_height = "match_parent" & gt; & Lt; LinearLayout Android: layout_width = "match_parent" Android: layout_height = "match_parent" android: orientation = "vertical" & gt; & Lt; Com.google.android.gms.ads.AdView xmlns: ads = "http://schemas.android.com/apk/res-auto" Android: id = "@ + id / adView" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content" ad: adUnitId = "CA application pub -7098126077977688/3494300657" ad: adSize = "banner" Android: layout_gravity = "center" / & gt; & Lt; ScrollView Android: layout_width = "match_parent" android: layout_height = "wrap_content" & gt; & Lt; LinearLayout Android: layout_width = "match_parent" android: layout_height = "wrap_content" Android: orientation = "vertical" & gt; & Lt; ImageView Android: id = "@ + id / ad_view_photo_image" Android: layout_width = "match_parent" Android: layout_height = "wrap_content" android: layout_gravity = "center" /> & Lt; TextView android: id = "@ + id / ad_view_description" android: text = "TextView" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content" android: padding = "5dp" Android: layout_gravity = "center" / & gt ; & Lt; TextView Android "Android: attr / textAppearanceLarge" id = "@ + id / ad_view_price" Android: Layout_width = "Wrap_content" Android: Layout_height = "Wrap_content" android: text = "Large Text" Android textAppearance = Android: Padding = "5dp "Android: layout_gravity =" center "/> & Lt; Button android: id = "@ + id / ad_view_buy" android: text = "Comprar" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content" android: padding = "5dp" Android: layout_gravity = "center" / & gt ; & Lt; Button android: id = "@ + id / ad_view_back" android: text = "Voltar" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content" android: padding = "5dp" Android: layout_gravity = "center" / & gt ; & Lt; / LinearLayout & gt; & Lt; / Scrollview & gt; & Lt; / LinearLayout & gt; & Lt; / FrameLayout & gt; & Lt; Layout = "layout / drawer" /> & Lt; /android.support.v4.widget.DrawerLayout>  

And the error:

The activity has leaked the window

Can someone give me some help? Thanks!

OK, I have solved the problem right now, this was a problem in my async work my small screen While not testing the app within the emulator, due to some reason not generated. I was trying to modify the view created by the main thread in async work.


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -