我知道如何在手机响铃时全局静音:
AudioManager audioManager = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
audioManager.setRingerMode(AudioManager.RINGER_MODE_SILENT);
Run Code Online (Sandbox Code Playgroud)
但我想静音电话铃声而不是全球静音.就像你点击手机上的声音按钮一样,它就会停止响铃.
我该如何以编程方式执行此操作?
我安装了https://play.google.com/store/apps/details?id=com.ivona.tts和他们所有的声音.如何以编程方式从ivona tts获取所有已安装语音的列表?
在android SDK 8中有没有这个命令?
我能以编程方式更改ivona tts的pico tts吗?仅适用于我的程序的整个手机?
我想创建4个正方形,在每个正方形中我想创建一个小按钮.广场必须是可见的,并且必须有边框.
我知道如何创建4个按钮作为正方形但我不知道如何在每个正方形周围创建边框.但我想要与尺寸无关,现在按钮非常大......
我的例子
<?xml version="1.0" encoding="utf-8"?>
<ViewFlipper xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent" android:layout_width="fill_parent">
<RelativeLayout android:id="@+id/magaLoginLayout"
android:layout_height="fill_parent" android:layout_width="fill_parent">
<Button android:text="@+id/Button01" android:id="@+id/Button01"
android:layout_width="160dip" android:layout_height="160dip" android:layout_marginTop="20dip"></Button>
<Button android:text="@+id/Button03" android:layout_below="@+id/Button01" android:id="@+id/Button03"
android:layout_alignLeft="@+id/Button01" android:layout_height="160dip" android:layout_width="160dip"></Button>
<Button android:text="@+id/Button04" android:layout_below="@+id/Button01" android:id="@+id/Button04"
android:layout_toRightOf="@+id/Button03" android:layout_height="160dip" android:layout_width="160dip"></Button>
<Button android:text="@+id/Button02" android:id="@+id/Button02" android:layout_width="wrap_content"
android:layout_toRightOf="@+id/Button01" android:layout_alignTop="@+id/Button01" android:layout_alignParentRight="true" android:layout_height="160dip"></Button>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
我想在可移植的 C# 类中实现这个逻辑:
static JsonWebToken()
{
HashAlgorithms = new Dictionary<JwtHashAlgorithm, Func<byte[], byte[], byte[]>>
{
{ JwtHashAlgorithm.HS256, (key, value) => { using (var sha = new HMACSHA256(key)) { return sha.ComputeHash(value); } } },
{ JwtHashAlgorithm.HS384, (key, value) => { using (var sha = new HMACSHA384(key)) { return sha.ComputeHash(value); } } },
{ JwtHashAlgorithm.HS512, (key, value) => { using (var sha = new HMACSHA512(key)) { return sha.ComputeHash(value); } } }
};
}
Run Code Online (Sandbox Code Playgroud)
但是HMACSHA256,HMACSHA384并且HMACSHA512在便携式库中不存在。
首先我尝试使用https://github.com/AArnott/PCLCrypto 但我总是得到: …
Html.CheckBox("SelectedStudents", false, new { @class = "check-item", id = x.Id, value = x.Id })
Run Code Online (Sandbox Code Playgroud)
哪个产生
<input checked="checked" class="check-item" id="4507" name="SelectedStudents" value="4507" type="checkbox">
<input checked="checked" class="check-item" id="4507" name="SelectedStudents" value="4508" type="checkbox">
<input checked="checked" class="check-item" id="4507" name="SelectedStudents" value="4509" type="checkbox">
Run Code Online (Sandbox Code Playgroud)
在mvc模型中,我有
public IEnumerable<string> SelectedStudents { get; set; }
Run Code Online (Sandbox Code Playgroud)
但是当我回帖时,SelectedStudents总是为空.为什么?在这个方法http://benfoster.io/blog/checkbox-lists-in-aspnet-mvc 写的:
ASP.NET MVC模型绑定器非常智能,可以将所选项映射到此属性.
但在我的例子中总是为空.为什么?如何编写更多复选框并将其绑定回来
我不想使用 foreach 和循环。我想使用 Java 8 中的流来查找 List 内的 Map 中的值
List<Map<String, Boolean>> types = ...
map.stream().filter(...
Run Code Online (Sandbox Code Playgroud)
问题是在过滤器中我无法按键/值对进行搜索。
我想获取 boolean = true 的所有元素
我做错了什么吗?
/**
* @return Returns the parameters.
*/
public Set<FeatureParameterDTO> getParameters() {
return this.parameters;
}
Run Code Online (Sandbox Code Playgroud)
我怎样才能从中获得价值getParameters?toString不行吗?什么是正确的方法?
[Serializable]
public class CommonsDbException : Exception
{
public CommonsDbException()
{
}
public CommonsDbException(string message, object[] args)
{
base.message = string.Format(message, args);
}
public CommonsDbException(string message, Exception innerException) : base(message, innerException)
{
}
protected CommonsDbException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
Run Code Online (Sandbox Code Playgroud)
但
public CommonsDbException(string message, object[] args)
{
base.message = string.Format(message, args);
}
Run Code Online (Sandbox Code Playgroud)
无效,我无法设置消息base.Message.
我想创建新消息,我该怎么办.父亲的消息没有二传手.
如何将这个C#6.0代码转换为C#4.0?
public void Subscribe(string message, Action<IMessagingService> callback) =>
MessagingCenter.Subscribe<MessagingService>(this, message, callback);
Run Code Online (Sandbox Code Playgroud)
要么
public object ConvertBack(object value, Type targetType, object parameter,
CultureInfo culture) => null;
Run Code Online (Sandbox Code Playgroud)
我可以简单地创建get属性吗?
[a-zA-Z0-9!#\$%\&'\*\+\-/\=\?\^_`\{\|\}~]+(\.[a-zA-Z0-9!#\$%\&'\*\+\-/\=\?\^_`\{\|\}~]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*
Run Code Online (Sandbox Code Playgroud)
这是验证电子邮件的正则表达式,但它不能正常工作.我现在测试了很多正则表达式,但都有问题.
问题是,如果您在开头和结尾输入可用空间,则电子邮件是有效的.
喜欢: " test@gmail.com "
如何防止空地?
c# ×4
android ×3
java ×3
.net ×1
asp.net ×1
asp.net-mvc ×1
bouncycastle ×1
excel ×1
java-stream ×1
regex ×1