我陷入了连接,我无法弄清问题在哪里,我有那些表
public class Themes
{
[PrimaryKey, AutoIncrement]
public int Id { get; set; }
public String ThemeName { get; set; }
public String ThemeDesc { get; set; }
public int ThemeImg { get; set; }
public String ThemeCategory { get; set; }
public String ThemeSubcategory { get; set; }
}
public class MusicItems
{
[PrimaryKey, AutoIncrement]
public int Id { get; set; }
public String Name { get; set; }
public String Tension { get; set; }
public String Category …Run Code Online (Sandbox Code Playgroud) 我试图改变Xamarin中TextView Drawable的颜色.
在Java中你可以这样做:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView txt = (TextView) findViewById(R.id.my_textview);
setTextViewDrawableColor(txt, R.color.my_color);
}
private void setTextViewDrawableColor(TextView textView, int color) {
for (Drawable drawable : textView.getCompoundDrawables()) {
if (drawable != null) {
drawable.setColorFilter(new PorterDuffColorFilter(getColor(color), PorterDuff.Mode.SRC_IN));
}
}
}
Run Code Online (Sandbox Code Playgroud)
我怎么能在Xamarin.Android中做这样的事情?
我试图在没有运气的情况下在 BOOT_COMPLETED 意图上运行一些代码。这是我尝试过的:
我的接收者:
using Android.App;
using Android.Content;
using System;
using System.Collections.Generic;
using System.Linq;
using onesentiment.Helpers;
using Newtonsoft.Json;
using Plugin.LocalNotifications;
using Android.Widget;
namespace onesentiment
{
[BroadcastReceiver(Name = "com.onesentiment.name.BootBroadcastReceiver", Enabled = true)]
[IntentFilter(new[] { Intent.ActionBootCompleted })]
public class BootUpReceiver : BroadcastReceiver
{
List<TaskReminder> CurrentTaskReminders = new List<TaskReminder>();
public override void OnReceive(Context context, Intent intent)
{
Toast.MakeText(context, "OnReceive", ToastLength.Long).Show();
if (intent.Action == Intent.ActionBootCompleted)
{
Toast.MakeText(context, "Intent.ActionBootCompleted", ToastLength.Long).Show();
if (Settings.TaskReminderList != string.Empty)
CurrentTaskReminders = JsonConvert.DeserializeObject<List<TaskReminder>>(Settings.TaskReminderList);
// Set up notification icon if necessary
var …Run Code Online (Sandbox Code Playgroud)