草庐IT

open-uri

全部标签

android - 如何获取存储在SDCARD中的图片的Uri?

我需要获取存储在SD卡上的图像的URI。当我想获取存储在drawable上的图像的Uri时,我使用它并且它完美地工作:i.putExtra(Intent.EXTRA_STREAM,Uri.parse("android.resource://"+getPackageName()+"/"+R.drawable.image));但是如果我想获取存储在SDCARD上的图像的URI,我尝试了这个,但它不起作用,出了点问题:i.putExtra(Intent.EXTRA_STREAM,Uri.parse("/mnt/sdcard/car.jpg"));拜托,有人能告诉我如何获取存储在sdcard上

android - 新的 KitKat URI 不响应 Intent.ACTION_VIEW

由于KitKat已将URI从选择器更改为喜欢content://com.android.providers.media.documents/document/image:3951那么我的ACTION_VIEWIntent都不再起作用了。例如,当用户选择图像时,我使用publicstaticvoidopenImage(Fragmentf,Uriuri){Intentintent=newIntent(Intent.ACTION_VIEW);intent.setDataAndType(uri,"image/*");f.startActivity(intent);}AndroidGallery

Error while loading shared libraries: libpq.so.5: cannot open shared object file: No such file or di

关于在用使用crontab计划任务使用pg_dump导出数据库的时候的报错:Errorwhileloadingsharedlibraries:libpq.so.5:cannotopensharedobjectfile:Nosuchfileordirectory遇到这个问题的情况是这样的:1、root用户执行脚本2、直接执行脚本正常,crontab定时执行报错3、postgres用户通过crontab执行,同样报错解决方案:根据个人系统位数,创建libpq.so.5的软链接1、找到ibpq.so.5,一般在PG_HOME/lib下2、创建软链接(个人为64位系统)ln-s/u01/Postgre

android - 查看来自内容提供者 URI 的 Intent ?

我有一些要求来保护一些敏感数据。数据从URL下载为PDF格式,并使用以下代码保存为应用程序私有(private)文件:publicFiledownloadPDF(finalContextfileContext,UrireportUri,finalStringfileName){try{HttpGetget=newHttpGet(reportUri.toString());Filefile=httpClient.execute(get,newResponseHandler(){@OverridepublicFilehandleResponse(HttpResponseresponse)t

android - 如何使用 ACTION_OPEN_DOCUMENT_TREE Intent 获取真实路径?

我的应用程序下载并解压缩特定文件夹中的文件:output=newFileOutputStream(realpath,true);output.write(buffer,0,bytesRead);ZipFilezipFile=newZipFile(realpath);随着新引入的ACTION_OPEN_DOCUMENT_TREEIntent,我想为用户提供选择该文件夹的机会。当测试在我的onActivityResult中接收到的值时,我得到一个类似/tree/primary:mynewfolder的路径,这不是像/这样的物理真实路径sdcard/mynewfolder.UritreeUr

android - { session 状态 :OPENING, token :{AccessToken token:ACCESS_TOKEN_REMOVED permissions:[]}, appId:1xxxxxxxxxxx}

我想在我的应用程序中实现Facebook登录,但我在尝试登录时遇到问题,即:**{Sessionstate:OPENING,token:{AccessTokentoken:ACCESS_TOKEN_REMOVEDpermissions:[]},appId:1xxxxxxxxxxxxxxx}**有时这个也是:**{Sessionstate:CLOSED,token:{AccessTokentoken:ACCESS_TOKEN_REMOVEDpermissions:[]},appId:1xxxxxxxxxxxxxxx}**注意:当我的设备已经安装了NATIVEFACEBOOKAPP时,会出

[jdk17]java.lang.reflect.InaccessibleObjectException:module java.base does not “opens java.util“

springboot2.3.1+drools+jdk17整合报错错误信息Causedby:org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'ruleInstance':Invocationofinitmethodfailed;nestedexceptionisjava.lang.ExceptionInInitializerError atorg.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPos

android - 如何将字符串转换为 android.net.Uri

问题:我发现java.net.URI有一个create(Stringuri)选项,但android.net.uri没有。更具体地说:我正在尝试获取RingtoneManager的RingtonePicker的输出并使用SetActualDefaultRingtoneUri将其设置为默认铃声:Intentintent=newIntent(RingtoneManager.ACTION_RINGTONE_PICKER);intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE,RingtoneManager.TYPE_RINGTONE);inte

安卓 : how to open a mail composer view?

我只想知道如何在Android中打开MailComposer。对于iOS,我会做这样的事情:MFMailComposeViewController*controller=[[MFMailComposeViewControlleralloc]init];[controllersetSubject:@"Mailsubject"];[controllersetMessageBody:@"Mailbody"isHTML:bool];[controllersetToRecipients:recipientsList];if(controller)[selfpresentModalViewCont

Android Intent.ACTION_CALL,URI

我正在尝试使用Intent.Action类。我知道如何使用ACTION_VIEW来显示URL,但我想在应用程序启动时使用Intent.ACTION_DIAL来调用号码。文档说您需要将URI解析为字符串,然后将其添加到Intent我试过这个:Uricall=Uri.parse("7777777777");Intentsurf=newIntent(Intent.ACTION_DIAL,call);startActivity(surf);这不起作用我收到一条错误消息:很遗憾,项目已停止。我尝试调试代码,它似乎将我指向Intent行,但我不确定我做错了什么,如果我只是这样做它就可以工作并调出拨