Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Dependecy service get interface

$
0
0

I´m using cross platform project and i need to delegate a specific code for teh android project and i create an interface

namespace SilenceTv1._0
{
public interface ISoundPlayer
{

    void Play();
}

}

and in a Button_Clicked event do this line but send me an error
DependencyService.Get().Play();

throws "System.MissingMethodException: Default constructor not found for type SilenceTv1._0.ISoundPlayer"

SilenceTv1._0.ISoundPlayer its a interface dont have constructor right?


Viewing all articles
Browse latest Browse all 77050

Trending Articles