سؤال

On my HTC Desire (Froyo) I use Power Control Widget to enable Wi-Fi. When I press Wi-Fi button a message "Turn on Wi-Fi" (inside gray tiny box) appears at bottom of home screen (and fades out after 2-3 seconds). I looked through Settings package (platform/packages/apps/Settings.git), but haven't found any usage of that specific string other that within Preferences view.

Does anyone have any idea what how this message is displayed and if this mechanism is available for 3rd party app?

هل كانت مفيدة؟

المحلول

نصائح أخرى

It's called a Toast.

You can invoke it in any activty.

Toast.makeText(CurrentClassName.this,"The message you would like to display",Toast.LENGTH_SHORT).show();

You can substitute Toast.LENGTH_SHORT for Toast.LENGTH_LONG depending on what you want.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top