我正在尝试使用Visual Studio在Xamarin Android中使用Xamarin Forms创建一个简单的应用程序,但是每次我尝试构建时都会遇到此错误.我仔细检查了我应该包含Portable项目的引用,并确保我有最新版本的Xamarin.Forms.我还能错过什么会产生这个错误?
using System;
using Android.App;
using Android.Content;
using Android.Content.PM;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
using App2;
using Xamarin.Forms.Platform.Android;
namespace App2.Droid
{
[Activity(Label = "App2", Icon = "@drawable/icon", MainLauncher = true,
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class MainActivity :
global::Xamarin.Forms.Platform.Android.FormsApplicationActivity // superclass new in 1.3
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
global::Xamarin.Forms.Forms.Init(this, bundle);
LoadApplication(new App()); // method is new in 1.3
}
}
}
Run Code Online (Sandbox Code Playgroud) 当我想在 MIPS 中的地址中存储一个值时,比如 $a0 中的值 3,我通常只使用 addi $a0, $0, 3。有时我看到人们使用 ori $a0, $0, 3 这样做。是一比另一个更好?有什么不同?
我正在尝试使用以下代码在我的应用程序中使用默认的Android pdf查看器查看托管的PDF文件
var intent = new Intent(Intent.ActionView);
intent.SetDataAndType(Uri.Parse("http://sample/url.pdf"), "application/pdf");
intent.SetFlags(ActivityFlags.ClearTop);
Android.Content.Context.StartActivity(intent);
Run Code Online (Sandbox Code Playgroud)
我在Native项目中使用过这段代码,所以我知道它在Android活动中有效.对于Xamarin Forms,我是否有办法从内容页面启动Android活动,反之亦然?