0
I’m using Xamarin Visual Studio Comunti 2015 After compiling a project, I get the following err:
Exception in thread "main"
1>java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0
1>Build FAILED.
1>
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
Code
using System;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
namespace Calculadora {
[Activity(Label = "Calculadora", MainLauncher = true, Icon = "@drawable/icon")]
public class MainActivity : Activity
{
EditText edtValor;
Button btnCalcular;
TextView txtGorjeta;
TextView txtValorTotal;
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
// Set our view from the "main" layout resource
SetContentView (Resource.Layout.Main);
edtValor = FindViewById<EditText>(Resource.Id.edtValor);
btnCalcular = FindViewById<Button>(Resource.Id.btnCalcular);
txtGorjeta = FindViewById<TextView>(Resource.Id.txtGorjeta);
txtValorTotal = FindViewById<TextView>(Resource.Id.txtValorTotal);
btnCalcular.Click += btnCalcular_Click;
}
void btnCalcular_Click(object sender,EventArgs e)
{
double valor = 0;
valor = double.Parse(edtValor.Text);
double valorTotal = 0;
valor = valor * .10;
valorTotal = valorTotal + valor;
txtGorjeta.Text = valor.ToString();
txtValorTotal.Text = valorTotal.ToString();
}
} }