我无法在 android 10 设备上获得串行。
我从这里了解所有内容(权限,运行时权限,只有在授予权限后才能获得序列号) android Build.GetSerial() throwing exception
我的代码适用于所有 android 版本,除了 10
你有什么想法?
我和Owin和Windsor有一个Web Api.
得到下一个错误:
发生错误.尝试创建"DBManagerController"类型的控制器时发生错误.确保控制器在System.Web.Http.Controllers.HttpControllerDescriptor.CreateController(HttpRequestMessage)上的System.Web.Http.Dispatcher.DefaultHttpControllerActivator.Create(HttpRequestMessage请求,HttpControllerDescriptor controllerDescriptor,类型controllerType)中具有无参数公共构造函数.System.InvalidOperationException.请求)在System.Web.Http.Dispatcher.HttpControllerDispatcher.d__1.MoveNext()发生错误.类型'Swissphone.SolutionKit.Utilities.DbInit.DataManager.WebHost.Controllers.DBManagerController'没有默认的constructorSystem.ArgumentException at System.Web.Http.Dispatcher.DefaultHttpControllerActivator.GetInstanceOrActivator的System.Web.Http.Internal.TypeActivator.Create [TBase](Type instanceType)中的System.Linq.Expressions.Expression.New(Type type)(HttpRequestMessage请求,类型为controllerType) System.Web.Http.Dispatcher.DefaultHttpControllerActivator.Create(HttpRequestMessage request,HttpCo),Func`1&activator)ntrollerDescriptor controllerDescriptor,类型controllerType)
这很奇怪,因为我注册了所有依赖项.
这是我的启动课:
public class Startup
{
public void Configuration(IAppBuilder app)
{
var httpContext = HttpContext.Current;
var hibernateConfigFileName = string.Empty;
if (httpContext != null)
{
hibernateConfigFileName = httpContext.Server.MapPath(Properties.Settings.Default.HibernateConfigFile);
}
else
{
throw new InvalidOperationException("When using IIS hosting, HttpContext.Current must not be NULL");
}
var windsorContainer = new WindsorContainer();
windsorContainer.Install(new ContextInstaller(), new DbInitInstaller());
var configuration = new HttpConfiguration() { DependencyResolver = new WindsorResolver(windsorContainer) };
configuration.Routes.MapHttpRoute("DBManager",
"api/{controller}/{action}/{id}",
new { id …Run Code Online (Sandbox Code Playgroud) 在我的 android 应用程序中,我有一个Service在应用程序进入后台时启动的应用程序。OnStartCommand开始分析和检查设备和应用程序状态的长时间运行的任务。
现在,我正在为 Android O 准备应用程序。我面临的第一个问题是Services,我将它们重新编写为JobServices.
现在我面临另一个问题。当用户从应用程序堆栈JobService.OnTaskRemoved中删除我的应用程序时不会被调用。
之前,当我使用Service调用时Service.OnTaskRemoved对我来说工作正常。
现在我看到了唯一的方法。我需要我的旧Service用于处理Service.OnTaskRemoved和新的JobServices用于执行任务。
我错了吗?也许有人可以给我很好的建议?