为什么没有图片显示?(Why no image shows?)
我有以下意图查看图像:
Intent intent = new Intent(Intent.ACTION_VIEW,uri); intent.setDataAndType(uri,"image/*"); try { startActivity(intent); } catch (Exception ex) { Toast.makeText(getApplicationContext(),ex.getMessage(),Toast.LENGTH_SHORT).show(); }
URI的
content://com.android.providers.media.documents/document/image:30506
是content://com.android.providers.media.documents/document/image:30506
但我得到“未找到媒体”。
我做错了什么?
I have the following Intent to View an image:
Intent intent = new Intent(Intent.ACTION_VIEW,uri); intent.setDataAndType(uri,"image/*"); try { startActivity(intent); } catch (Exception ex) { Toast.makeText(getApplicationContext(),ex.getMessage(),Toast.LENGTH_SHORT).show(); }
where the URI is
content://com.android.providers.media.documents/document/image:30506
but I get "Media non found".
What an i doing wrong?
原文:https://stackoverflow.com/questions/22430972
更新时间:2022-05-26 16:05
最满意答案
尝试将弹出窗口添加到
TabComponentsDemo
演示的自定义组件。Try adding your popup to the custom component demonstrated in
TabComponentsDemo
.
相关问答
更多-
您正在调用js函数而不是链接,因此无法在选项卡中打开页面。 您可以将链接修改为 I'm a link 或者直接url作为href值来实现目标。 You are calling a js function not a link, so it'll not possible to open the page in a tab. You can modify your link as ...
-
如何通过单击引导程序中当前选项卡内的按钮转到其他选项卡(how to go to other Tab by clicking button inside the current Tab in bootstrap)[2021-10-01]
你需要将这段代码添加到你的script.js文件中,我假设你已经创建了它,然后只需将这个代码段粘贴到它上面。 $(document).ready(function(){ $('.next').click(function(){ $('.nav-tabs a[href="#menu3"]').tab('show'); console.log(1111); }); }); 这是我在bootsnip上创建的一个片段: http ://bootsnipp.com/u ... -
单击选项卡隐藏选项卡,而不是单击网站的任何部分(Hide tab by clicking the tab instead of clicking any part of the website)[2021-09-10]
查看jQuery.tabSlideOut插件代码,您可以在此处看到: https://gist.github.com/katowulf/2655810#file-jquery-tabslideout-1-3-js-L164-L165 该document正在侦听隐藏回调中菜单的单击事件。 $(document).click(function(){ slideIn(); }); 如果您不想使用此功能,我建议从插件中删除这部分代码。 如果您认为将来可能需要此功能,可以通过向初 ... -
根据 TabHost.setup (LocalActivityManager) 上的文档 ,你应该调用TabHost.setup (LocalActivityManager)因为你将它与TabHost.setContent(Intent)结合使用: 如果您正在使用setContent(android.content.Intent),则必须调用此方法,因为启动本地活动需要activityGroup。 如果扩展TabActivity,则会为您完成此操作。 换句话说,如果您只是让您的活动扩展TabActivity ...
-
关闭单击的选项卡,而不是当前选定的选项卡JTabbedPane(Close the clicked tab, not the currently selected tab JTabbedPane)[2023-06-13]
你的actionPerformed()方法调用你的closeTab()方法。 您的closeTab()方法从选项卡式窗格中删除当前选定的选项卡。 相反,您需要使用单击的按钮删除与选项卡对应的组件。 创建Tab ,还要将构造函数作为选项卡窗格内容传递给构造函数。 然后,您可以在actionPerformed()方法中使用它,并将组件传递给closeTab() public void actionPerformed(ActionEvent e) { closeTab(component); } priva ... -
尝试将弹出窗口添加到TabComponentsDemo演示的自定义组件。 Try adding your popup to the custom component demonstrated in TabComponentsDemo.
-
在List的onItemSelected事件上使用TabHost.setCurrent(int) use TabHost.setCurrent(int) on the List's onItemSelected event
-
在你的片段中尝试这个 : ViewPager mviewPager = (ViewPager) getActivity().findViewById(R.id.viewpager); 此id将是您在活动布局中给出的viewpager id。 然后就这样使用它。 mviewPager.setCurrentItem(2); Try this in your fragment : ViewPager mviewPager = (ViewPager) getActivity().findViewById(R.id ...
-
OnLoad事件仅在首次创建对象时发生 Load事件在创建控件之后但在控件第一次可见之前发生。 不是在你改变焦点时。 如果您想在每次用户选择TabConrol上的选项卡时运行某些内容,则可以使用另一个事件。 TabIndexChanged看起来是你最好的选择, GotFocus也可以看一下。 焦点事件按以下顺序发生: 输入 的GotFocus 离开 证实 验证 引发LostFocus The answer turns out to be to use OnRefresh(): public override ...
-
单击JTabbedPane上的选项卡时,组件不会立即显示(When clicking a tab on a JTabbedPane the components don't appear immediately)[2023-06-07]
你在混合一些awt和摇摆的东西? 这可能会产生如此不可预测的影响。 thanks a milion for your response, the problem was calling repaint() of a component that called when i changing it position, the location of marker must be change every time the map move by user or page event occurred, so ...