5

When I use toasts in my app, the size is very very small. But when another app displays a toast, the size is normal (like Advanced Task Killer, or SMS).

What do I have to do to get normally-sized toasts?

I have a Galaxy Nexus ICS=4.0.1, and my app is using SDK API level 7 (android 2.1+).

Nick
  • 3,504
  • 2
  • 39
  • 78
Christian
  • 748
  • 7
  • 23

4 Answers4

6

Thank you ! (x1000)

Adding

    <supports-screens android:resizeable="true"
                  android:smallScreens="true"
                  android:normalScreens="true"
                  android:largeScreens="true"
                  android:anyDensity="true"/>

to my manifest, solved my problem...

cad13
  • 76
  • 1
2

you may need to use a Custom ToastView

elijah
  • 2,904
  • 1
  • 17
  • 21
  • Yes it's a solution, but I prefer using the basic one. The problem is the size is different between the toast in my app (very small) and the same basic toast (not custom) in other apps (normal size). – Christian Jan 09 '12 at 21:22
  • I believe this is your only viable solution, you can't even so much as alter the font in the default toast view. – arkon Jan 10 '12 at 02:01
  • May be I don't explain correctly my problem... I'm not requesting to custom the Toast, not change the font. I just do not understand why in my app, toast are very small and in other apps, the same toast (not customized) are with the normal size. I just want my toast be at the normal size, not customized size. I think the problem is from the screen resolution (HD on Galaxy Nexus), and may be there is something to initialize in Manisfest ? – Christian Jan 10 '12 at 05:24
0

Maybe this is a theme problem... Can you try to implement Using Holo while supporting Android 2.x in this post ?

Anasthase
  • 491
  • 2
  • 7
  • I tried this and it didn't make the Toasts any bigger. In retrospect, this makes sense. According to that same most, without specifying any theme at all on ICS, you get DeviceDefault, which on Galaxy Nexus is already Holo. – MaximumGoat Jan 12 '12 at 07:39
  • 1
    In the previous link, from the "Defaults for Older Apps" paragraph, if you run an app whith targetSdk < 11 on ICS, you will get `@android:style/Theme`, not DeviceDefault. So it does not make sense for me... But i have no other idea to solve this :( – Anasthase Jan 12 '12 at 08:16
0

I finally fixed this by removing android:anyDensity="false" from my supports-screens element in my manifest. I'm not sure why I had it there in the first place, except that I started that app from one of my rather old apps instead of from scratch.

That setting also caused my activity to be realllllly small (order the order of 25px by 20px) when I ran with targetSdkVersion 14 or 15 on my nexus. Seems like a bug.

MaximumGoat
  • 3,287
  • 3
  • 16
  • 15