在KitKat之前(或在新Gallery之前)Intent.ACTION_GET_CONTENT返回这样的URI
内容://媒体/外部/图像/媒体/ 3951.
使用ContentResolver和quering
MediaStore.Images.Media.DATA返回文件URL.
但是在KitKat中,Gallery会返回一个URI(通过"Last"),如下所示:
内容://com.android.providers.media.documents/document/image:3951
我该如何处理?
android android-intent android-contentresolver android-gallery
我已经在ListView中启用了快速滚动,它具有不可选择的标题视图.如果向下滚动列表并将快速滚动滑块拖动到顶部,则列表仅向后滚动到第一个元素,而不是向标题视图滚动.拖动列表,按预期工作.
屏幕截图1:屏幕截图中的红色区域是标题视图.
屏幕截图2:如果您将拇指拖到顶部,则只能获得第一个元素,标题视图仍然位于上方.
ListView lv = (ListView) findViewById(R.id.listView);
lv.addHeaderView(getLayoutInflater().inflate(R.layout.view,null), null, false);
Run Code Online (Sandbox Code Playgroud)
<ListView
android:layout_height="fill_parent"
android:id="@+id/listView"
android:layout_width="fill_parent"
android:fastScrollEnabled="true"
></ListView>
Run Code Online (Sandbox Code Playgroud)
我创建了一个演示项目:https: //github.com/mikegr/fastscroll-bug
为什么拖动拇指不会滚动回到顶部?

在Android 6.0 Marshmallow上,EditText相对于RelativeLayout中的ImageView与属性baseline和layout_alignBaseline的定位不再起作用.甚至可以在Android studio的布局编辑器中观察到这种行为.在一个真正的Android Marshmallow设备或emulatr上,我的情况下EditText移出屏幕并且不可见.我是否会错过一些更改,这是一个错误吗?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MainActivityFragment">
<ImageView
android:layout_width="48dp"
android:layout_height="48dp"
android:id="@+id/imageView"
android:src="@drawable/icon_category_geography_raster"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:baselineAlignBottom="true"
android:background="#00ffff"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/editText"
android:layout_alignParentTop="true"
android:layout_toRightOf="@id/imageView"
android:background="#ff0000"
android:inputType="text"
android:hint="Hint"
android:layout_alignBaseline="@id/imageView" />
Run Code Online (Sandbox Code Playgroud)
我创建了Android Studio布局编辑器的截图.这两个屏幕截图之间的区别仅在于API级别的更改.
我创建了一个示例项目 https://github.com/mikegr/baseline
android android-layout android-relativelayout android-6.0-marshmallow
在具有指纹扫描仪(例如P9)的华为设备上使用KeyguardManager.createConfirmDeviceCredentialIntent()时,该屏幕仅适用于PIN /密码,但不允许使用指纹扫描仪进行解锁。在大多数其他有效的品牌上。这是一个已知的问题?我找不到任何堆栈溢出条目。华为知道这个问题吗?
我知道我可以使用Fingerprint API,但是此方法已从Android 5.0开始运行,并且不仅限于指纹。
如果你在RadioGroup中有更多的单选按钮并希望它们伸展,而不是挤进小按钮,我想把RadioGroup放在ScrollView中.但这不起作用.任何人都知道如何实现这一目标?
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:fillViewport="true"
>
<RadioGroup
android:id="@+id/news_radiogroup"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<RadioButton />
<RadioButton />
<RadioButton />
<RadioButton />
and more
</RadioGroup>
</ScrollView>
Run Code Online (Sandbox Code Playgroud)