I found out that in the fourth android there are no toasts, how can I implement them?

upd: I wrote in OnCreate :

 mToast = Toast.makeText( this , "" , Toast.LENGTH_LONG ); 

then where do i do

 mToast.cancel(); mToast.setText("Текст"); mToast.show(); 

(All this in order to not show more than one toast!) In 2.3 it works in 4 - no!

Maybe someone will tell you how to do it correctly so that the toasts are not accumulated, and when called, the previous one was canceled?

  • one
    Are you sure there are no toasts in ICS ?! It can not be! They are definitely there - check, and then write! - Barmaley
  • My application is all in toasts, the user writes that in 4.0.3 the toasts do not float, I cut down the emulator and the truth! - katso
  • Tonight I will check on the emulator ... Generally strange - Barmaley

3 answers 3

I checked on the ICS emulator - there are toasts. There is no access to the device so that I cannot say anything, but there is no reason not to trust millions of users.

There is a small problem with toasts in ICS - they are very small - maybe your user simply does not see them. As the people write , the problem is solved by inserting a declaration of support for large resolutions into the manifest:

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

    It is not yours, they are there and have not gone anywhere.

    • The fact remains a fact! maybe I crookedly call them simply that they don't stupidly emerge in the four - katso
    • Well so. Documentation did not try to read? Sometimes it is useful. public void cancel () Since it’s API. You do not normally have to call this. Normally view the appropriate duration. - falstaf 2:55 pm

    Toast-s work fine on an emulator as well as on a real device, it is checked. The ICS is not so radically changed everything to remove toasts. In general, in the system, the UI of which is ideologically built on dialogues, pop-up windows and other popup-garbage, they abruptly picked up and removed pop-up hints. I have the only suspicion that your "user who reported a lack of toast" may have some very neutered firmware. In my practice, there were complaints from one user about the departure of the application, as it turned out he had MUIU. And the handsome men of this firm have somehow redefined the standard tabs in their own way, the toli indexation violated something else (I don’t remember exactly)