toast message inside thread

All your problems with Audio, Video and Images.

toast message inside thread

Postby aswani » Wed Jun 16, 2010 12:26 pm

Hi folks

i am using scheduleAtFixedRate for getting data from webservices

i need to disply toast message in timer thread

how to do that

Thanks in advance

Aswan
aswani
Junior Developer
Junior Developer
 
Posts: 19
Joined: Tue Feb 09, 2010 12:41 pm

Top

Re: toast message inside thread

Postby pskink » Wed Jun 16, 2010 12:47 pm

don't use Timers

use Handlers instead
pskink
pskink
Master Developer
Master Developer
 
Posts: 719
Joined: Mon Nov 24, 2008 3:49 pm

Re: toast message inside thread

Postby aswani » Wed Jun 16, 2010 1:01 pm

if you any code of using handler please send to me
aswani
Junior Developer
Junior Developer
 
Posts: 19
Joined: Tue Feb 09, 2010 12:41 pm

Re: toast message inside thread

Postby underminedsk » Wed Jun 23, 2010 6:29 pm

This probably isn't the right thing to do, but you could write something like this in your main activity:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public static void announceText(String textToAnnounce) {
  2.      Toast.makeText(context, textToAnnounce, Toast.LENGTH_SHORT)).show();
  3. }
  4.  
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


Then, you could call it from any class in your application.

cheers,

Zach
underminedsk
Developer
Developer
 
Posts: 26
Joined: Tue Mar 02, 2010 3:36 am

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 15 guests