Xamarin.Forms: Start an activity using DependencyS

2019-09-03 14:41发布

In my Xamarin.Forms.Page I have a DependencyService that must activate an activity in my .Droid project. How do I activate the Activity? I've tried

StartActivity(typeof(FacebookActivity));

but I get

Java.Lang.NullPointerException: Exception of type 'Java.Lang.NullPointerException' was thrown.

What do I have to initialize?

1条回答
可以哭但决不认输i
2楼-- · 2019-09-03 15:16

Found out the problem. I have to put an explicit constructor

public FacebookActivity(){}
查看更多
登录 后发表回答