to add to what marcin said, if your wifi class doesn't extend Activity, and is simply a utility class/or some class that you call from an Activity, you simply need to pass the Activity class' instance, "this", to the scan() method.
however, if your wifi class extends "Thread", then you'd be better off keeping in mind the rules of NOT updating the UI from any thread other than the main thread. On Jun 4, 11:25 am, seema <[email protected]> wrote: > Hello All, > > // File MyService.java > public class MyService extends Service { > .... > Toast.makeText(this, "Displayed", Toast.LENGTH_SHORT).show(); // > WORKS FINE > scan(); > > } > > //File wifi.java > public class wifi extends ???????? { > ..... > public void scan() { > ..... > Toast.makeText(??????, "Inside Wifi", > Toast.LENGTH_SHORT).show(); > } > > } > > How can I use Toast in the file wifi.java ? > > Regards, > Seema -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

