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]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en