草庐IT

uri-scheme

全部标签

Android HTML 电话链接 err_unknown_url_scheme

我在带有5.5.1/Lollipop的库存Nexus5上实现一个看似极其简单的解决方案,但遇到了困难。我希望直接在手机上存储本地HTML页面以保存大量引用电话号码列表:CallHarold'sChickenShackCallInn'OutBurger这曾经没有任何问题,但今年早些时候的某个时候Android更新禁用了它。以前,单击该链接会打开手机上的拨号器并开始调用该号码。现在,另一个网页显示为“网页不可用”,正文中包含“无法加载位于tel:123-456-7890的网页,因为:net::ERR_UNKNOWN_URL_SCHEME”。我已经在谷歌上进行了大量搜索,但仍不清楚解决方案。

android - 从通过 FileProvider 创建的 Uri 获取文件路径

我使用此方法从Urihttps://github.com/iPaulPro/aFileChooser/blob/master/aFileChooser/src/com/ipaulpro/afilechooser/utils/FileUtils.java#L257获取文件路径但是当我传递如下创建的Uri时它抛出异常(“_data”列未找到):publicstaticUriuriFromFile(Contextcontext,Stringpath){if(path==null)returnnull;returnFileProvider.getUriForFile(context,Build

android - Android Nougat 锁屏中 URI 的 startActivity

我正在使用从AlarmManager接收广播的BroadcastReceiver。在接收器中,我开始了两项Activity。一个Activity是从这样的URI开始的,并且是第三方应用程序://OpenspotifyIntentspotify=newIntent(Intent.ACTION_VIEW,Uri.parse(song));spotify.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);try{context.startActivity(spotify);}catch(ActivityNotFoundExceptione){status=Sta

android - 如何裁剪 Android 中已知 URI 的图像?

我希望在imageview中显示的图像选择特定部分(并且只有选定部分需要突出显示,其他部分半透明)并且该部分也可以根据需要调整大小或由用户在触摸事件中完成。现在,需要裁剪图像的选定部分,然后显示并保存裁剪后的图像。编辑:我使用Intent打开图像并使用intent.putExtra("crop","true");对其进行裁剪但是在传递Intent时,我想打开URI已知的图片,而不是打开图片库的整个相册。任何人都可以建议,我如何通过打开图像的Intent传递来打开特定的URI。提前致谢。 最佳答案 关于问题的最后一部分,如果您使用的是

android - 更改 MediaPlayer URI

我有以下工作代码:@OverrideprotectedvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);this.setContentView(R.layout.player);videoView=(VideoView)this.findViewById(R.id.videoView);playVideo();//videofinishlistenervideoView.setOnCompletionListener(newMediaPlayer.OnCompletionListener(

android - Intent : URI not working in Android browser

所以我点击这个链接:Google(我知道这是一个愚蠢的例子,因为它可能只是http://www.google.com,但它说明了问题)我从中确定了这个URILog.v(newIntent(Intent.ACTION_VIEW).setData(Uri.parse("http://www.google.com")).toUri(Intent.URI_INTENT_SCHEME));我在logcat中看到以下内容:08-0208:32:34.708I/ActivityManager(71):Startingactivity:Intent{act=android.intent.action.

android - 从 Android Lollipop 中的 Uri 裁剪照片后总是返回 Null?

我尝试在拍照或选择图片后从Uri裁剪图像。我的代码是这样的:publicstaticvoidcropImage(Uriuri,Activityactivity,intaction_code){Intentintent=newIntent("com.android.camera.action.CROP");intent.setDataAndType(uri,"image/*");intent.putExtra("crop","true");intent.putExtra("aspectX",1);intent.putExtra("aspectY",1);intent.putExtra("

java - 如何获取使用 FileOutputStream 保存的文件的 URI?

这是将图像文件保存到...某处的代码?如何获取文件“webimage”的URI?Bitmapbmp=((BitmapDrawable)imageView.getDrawable()).getBitmap();StringfileName="webImage";//no.pngor.jpgneededtry{ByteArrayOutputStreambytes=newByteArrayOutputStream();bmp.compress(Bitmap.CompressFormat.JPEG,100,bytes);FileOutputStreamfo=openFileOutput(fil

无法使用FileProvider发送正确的URI

我正在使用此路径创建文件Filefile=newFile(getExternalFilesDir(null)+"/package.apk");然后我试图使用此代码发送它Intentintent=newIntent(Intent.ACTION_VIEW);intent.setDataAndType(FileProvider.getUriForFile(UpdateActivity.this,getPackageName()+".provider",file),"application/vnd.android.package-archive");Log.d("uri",FileProvider.g

android - 如何将 URL 转换为 URI?

我正在尝试使用此代码缓存这些图像...但我总是在这里收到语法错误?UriimageUri=newUri(aURL);这是我使用的代码。URLaURL=newURL(myRemoteImages[position]);UriimageUri=newUri(aURL);if(newFile(newFile(myContext.getCacheDir(),"thumbnails"),""+imageUri.hashCode()).exists()){StringcachFile=""+imageUri.hashCode();FileInputStreamfis;try{fis=newFile