Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MyService extends Service {
- private static final String TAG = "MyService";
- @Override
- public void onCreate() {
- Toast.makeText(this, "My Service Created", 0).show();
- }
- @Override
- public void onDestroy() {
- Toast.makeText(this, "My Service Stopped", 0).show();
- Log.v(TAG, "onDestroy");
- }
- public int onStartCommand(Intent intent, int flags, int startId) {
- Toast.makeText(this, "On Start Command - service started", 0).show();
- Log.v(TAG, "onStart");
- **return START_STICKY;**
- }
- @Override
- public IBinder onBind(Intent intent) {
- return null;
- }
- }
Add Comment
Please, Sign In to add comment