解析后我的文件"s"包含 AttributeGet:1,16,10106,10111
所以我需要在attributeIDGet List中获取冒号后面的所有数字.我知道有几种方法可以做到这一点.但是我们有什么方法可以直接转换List<String>为List<Integer>.
由于下面的代码抱怨类型不匹配,所以我尝试做Integer.parseInt,但我想这对List不起作用.这是s字符串.
private static List<Integer> attributeIDGet = new ArrayList<Integer>();
if(s.contains("AttributeGet:")) {
attributeIDGet = Arrays.asList(s.split(":")[1].split(","));
}
Run Code Online (Sandbox Code Playgroud) Uri sound = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + context.getPackageName() + "/" + R.raw.notification_mp3);
mBuilder.setSound(sound);
Run Code Online (Sandbox Code Playgroud)
我已将mp3(notification_mp3.mp3)文件复制到res文件夹中的raw文件夹中.当通知被触发时,它产生给定的mp3声音到Android Nougat但在Android Oreo中默认声音.我曾推荐过许多网站,但在Android Oreo上没有任何效果.我没有发现Android Docs中有关Android O及以上版本的通知声音的任何更改.应该做些什么更改才能使此代码在Android O中运行?
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="@dimen/padding_small_6"
android:includeFontPadding="false"
android:text="@string/forgot_password_hint"
android:drawableStart="@drawable/ic_edit"
android:textSize="@dimen/text_size_medium_14"/>
Run Code Online (Sandbox Code Playgroud)
这是我的文本视图。我想将可绘制对象设置在此文本视图的左侧。但问题是,如果文本是多行的,则可绘制对象在文本视图中显示为中心垂直。
是否有任何选项可以在文本视图的左上角设置可绘制对象?