C# Class ServicesDemo3.TimestampService

Inheritance: Android.App.Service
Mostra file Open project: xamarin/monodroid-samples Class Usage Examples

Public Methods

Method Description
OnBind ( Android.Content.Intent intent ) : IBinder
OnCreate ( ) : void
OnDestroy ( ) : void
OnStartCommand ( Android.Content.Intent intent, StartCommandFlags flags, int startId ) : StartCommandResult

Private Methods

Method Description
BuildIntentToShowMainActivity ( ) : Android.App.PendingIntent

Builds a PendingIntent that will display the main activity of the app. This is used when the user taps on the notification; it will take them to the main activity of the app.

BuildRestartTimerAction ( ) : Notification.Action

Builds a Notification.Action that will instruct the service to restart the timer.

BuildStopServiceAction ( ) : Notification.Action

Builds the Notification.Action that will allow the user to stop the service via the notification in the status bar

GetFormattedTimestamp ( ) : string

This method will return a formatted timestamp to the client.

RegisterForegroundService ( ) : void

Method Details

OnBind() public method

public OnBind ( Android.Content.Intent intent ) : IBinder
intent Android.Content.Intent
return IBinder

OnCreate() public method

public OnCreate ( ) : void
return void

OnDestroy() public method

public OnDestroy ( ) : void
return void

OnStartCommand() public method

public OnStartCommand ( Android.Content.Intent intent, StartCommandFlags flags, int startId ) : StartCommandResult
intent Android.Content.Intent
flags StartCommandFlags
startId int
return StartCommandResult