草庐IT

EXTERNAL_CONTENT_URI

全部标签

android - 为什么 Wrap_Content 不止一次触发 BindView

我正在开发一个带有listView的Android应用程序,并且正在对其进行优化。它在一个Activity中使用自定义游标适配器,我注意到bindview()为列表的每一行触发了两次。在此处研究BindView()和NewView()方法时,我在一篇文章中读到,将Wrap_Content作为我的ListView的宽度是个坏主意。我将其切换为Fill_Parent和viola现在bindview()和newview()每个项目只触发一次。为了更好地理解Andorid操作系统的内部结构,我想知道为什么Wrap_Content导致bindview()多次触发。我在Google、Android

android - Facebook Android sdk 在身份验证上抛出丢失的重定向 uri

我正在使用Facebookandroidsdk用我的安卓应用程序。在开发我的开发版本时,我的应用程序一切正常。当我最终向公众发布我的应用程序时,当人们尝试对我的应用程序进行身份验证时,facebook身份验证会吐出一个丑陋的错误:APIErrorcode:100APIErrordescription:InvalidparameterErrorMessage:RequiresvalidredirectURI似乎facebook认为我正在对它们进行浏览器重定向并缺少重定向uri以返回到我的应用程序,但我使用的是androidsdk,其中你不发送重定向uri,你有一个回调监听器:facebo

android - WRITE_EXTERNAL_STORAGE 不适用于 Lollipop ,即使它已在 list 中设置

我正在尝试将图像从应用程序本地数据文件夹保存到外部存储。我的list包含以下内容(在list的应用程序标记之前):当我尝试以下操作时try{InputStreamin=newFileInputStream(filePath);FileoutPath=Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);FileoutFile=newFile(outPath,"mypicture.jpg");//tryfailsatthislineOutputStreamout=newFileOutpu

android - 是否可以使用 Uri.Builder 而没有 "//"部分?

我正在尝试构建一个mailto:uri以使用GMail应用程序发送邮件。我想使用android.net.Uri.Builder类来执行此操作,但生成的uri的格式为mailto://test@example.com,这使得GMail应用认为收件人是//test@example.com,而不仅仅是test@example.com。我最终这样做了:StringuriStr=uriBuilder.toString();uriStr=uriStr.replaceAll("//","");finalUriuri=Uri.parse(uriStr);但显然,这是一个丑陋的hack...没有//部分

android - 如何转换内容://Uri into actual file path?

如何获取content://uri指向图像的SD卡上的实际文件路径? 最佳答案 我修改了@hooked82链接到的代码:protectedStringconvertMediaUriToPath(Uriuri){String[]proj={MediaStore.Images.Media.DATA};Cursorcursor=getContentResolver().query(uri,proj,null,null,null);intcolumn_index=cursor.getColumnIndexOrThrow(MediaStore

android - 在android中将真实路径格式转换为Uri

例如真实路径是mnt/sdcard/image_1.jpgUri路径是这样的content://media/external/images/media/140UriphotoUri=Uri.parse("content://media/external/images/media/140");Log.d("selectedphoto",""+photoUri);selectedImagePath=getPath(photoUri);publicStringgetPath(Uriuri){String[]projection={MediaStore.Images.Media.DATA};C

android - 在 Android 中从 URI 检索联系电话号码

在从内置Activity中检索到他们的ID号码后,我试图获取联系人的电话号码。但是,每当我在下面的代码中使用游标查询数据库时——即使我选择的联系人有一个手机号码,我也会返回零行。谁能给我指明更好的方向或举例说明如何在获取用户ID后获取联系人的电话号码?我的代码:privateRunnablegetSMSRunnable(){returnnewRunnable(){publicvoidrun(){Intenti=newIntent(Intent.ACTION_PICK,ContactsContract.CommonDataKinds.Phone.CONTENT_URI);startAct

android - 内容提供者 URI 匹配器

在实现ContentProvider时定义所有URI的文档中有明确的建议.但我对URI匹配器部分感到困惑:例如,我有包org.company.example,表名为“items”,然后我定义了publicstaticfinalUriCONTENT_URI=Uri.parse("content://org.company.example.sampleprovider/items");我应该使用什么授权部分来匹配静态初始化中的URI:privatestaticfinalUriMatcheruriMatcher;static{uriMatcher=newUriMatcher(UriMatch

android - 如果设置 layout_height = wrap_content,ViewPager 不工作

我在使用ViewPaper时遇到问题。当我设置ViewPaper的height=wrap_content时它没有显示任何内容,如果我为ViewPager设置高度它会显示(例如:android:layout_height="350dp")。请帮忙!谢谢!这是我的xml代码:已解决:我点击此链接,它帮助我解决了这个问题。https://stackoverflow.com/a/24666987/1928560 最佳答案 必须指定ViewPager高度match_parent或者您必须为其指定一个值。两种解决方案,在LinearLayout

android - 这个 LinearLayout 应该使用 android :layout_height ="wrap_content"?

我有以下xml布局:hereIgettheerror.android:orientation="vertical">但我收到了lint消息:ThisLinearLayoutshoulduseandroid:layout_height="wrap_content"为什么我会收到这条消息? 最佳答案 LinearLayout设计用于并排或堆叠元素。我的猜测是,由于ScrollView,此lint警告建议使用虚拟堆叠Documentation:“LinearLayout的所有子项都一个接一个地堆叠,因此垂直列表每行只有一个子项,无论它们有