How about starting with the API demo, which is working with a notification and everything?
http://developer.android.com/guide/samples/ApiDemos/src/com/example/android/apis/app/LocalService.html On Tue, Nov 24, 2009 at 12:55 AM, Wei Jian <[email protected]> wrote: > Hello. i wish to use implement Service in my application to display a > message on the screen. This service should run while my application is > running. But right now, i just want to test the service function and > the Service doesn't seem to work well. > > In the main java file, i call startService(new Intent > (this,testing.class)); > > And the testing.java code is as below. > > package com.example.helloandroid; > > //import android.app.NotificationManager; > import android.app.Service; > import android.content.Intent; > import android.os.IBinder; > import android.widget.Toast; > > public class testing extends Service{ > > > @Override > public void onCreate() { > Toast mToast = Toast.makeText(this, R.string.app_name, > Toast.LENGTH_LONG); > mToast.show(); > } > > > @Override > public IBinder onBind(Intent arg0) { > // TODO Auto-generated method stub > return null; > } > > > } > > > Why it isn't displaying the Toast message? Can anyone help please!!! > > -- > 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]<android-developers%[email protected]> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- 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

