草庐IT

explicit-intent

全部标签

javascript - 在 doc : It isn't possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened. 上执行写入

我正在尝试在页面加载执行后加载某个脚本,如下所示:functiondownloadJSAtOnload(){varelement=document.createElement("script");element.src="scriptSrc";document.body.appendChild(element);}if(window.addEventListener)window.addEventListener("load",downloadJSAtOnload,false);elseif(window.attachEvent)window.attachEvent("onload",

mongodb - "Closed Explicitly"mgo Go 中的 MongoDB

我有一个运行10个Web服务(同类)的Docker集群。他们都在使用MongoDB,其中包括用于数据持久性的东西。这是在服务启动时从main()调用的代码://InitestablishesaconnectionwithMongoDBinstance.funcInit(mongoURLstring)*mgo.Session{mongo,err:=mgo.Dial(mongoURL)misc.PanicIf(err)//makesurewearestronglyconsistentmongo.SetMode(mgo.Strong,true)//updateglobalstatedb=mo

mysql - 如何启用explicit_defaults_for_timestamp?

当我尝试启动mySQL服务器时,我收到消息:[Warning]TIMESTAMPwithimplicitDEFAULTvalueisdeprecated.Pleaseuse--explicit_defaults_for_timestampserveroption(seedocumentationformoredetails).我在以下位置找到答案:http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_explicit_defaults_for_timestamp但是如何启用它呢?在哪里?

ANDROID:如果 WiFi 已启用且处于 Activity 状态,则启动 Intent

这就是我想做的:=>如果WiFi已启用且处于Activity状态,则启动一个Intent(实际上它是一个获取其内容的WebView=>我的应用在网络上的说明)=>如果不是,那么我将启动另一个Intent,这样我就不会显示带有“网页不可用...http://www.mywebsite.com的网页可能暂时关闭或可能已移动..。”我最初坚持使用如果(wifi.isWifiEnabled())但这并不能说明Wifi连接是否处于Activity状态。它只说用户打开了开关。设备可能已连接,也可能未连接...这是正确的吗?然后我尝试使用:如果(wifi.getConnectionInfo().ge

android - 以 Intent ACTION_IMAGE_CAPTURE 开始设置 android 相机的方向

这个问题在这里已经有了答案:WhydoesanimagecapturedusingcameraintentgetsrotatedonsomedevicesonAndroid?(23个回答)关闭4年前。我正在使用相机拍摄照片的android应用程序。为了启动相机,我正在使用intentACTION_IMAGE_CAPTURE像这样:Intentcamera=newIntent(MediaStore.ACTION_IMAGE_CAPTURE);Fileimage=newFile(Environment.getExternalStorageDirectory(),"PhotoContest.

android - 从 Intent.ACTION_PICK 返回的 URI 中获取特定的联系信息

我正在编写一个Android应用,它的数据类型代表一个人(特别是child的parent或监护人)。我希望能够从Android设备的联系人数据库中“导入”相关数据字段。(这应该是可选的;也就是说,不需要parent/监护人已经在联系人数据库中,如果他们添加新的parent/监护人,联系人数据库也不会更新。)到目前为止,我已经编写了代码来启动一个新的Intent来选择特定的联系人(使用Intent.ACTION_PICK)。然后我得到一个代表数据库中特定联系人的URI。不幸的是,我不知道下一步是什么。看起来这应该是世界上最简单的事情,但显然不是。我已经阅读了Android开发者网站上的文

android - 将多个标志传递给android中的 Intent

我有这个Activity列出了一些我提供刷新按钮的信息。我刷新它的方式(可能无论如何都不是最好的方式)只是重新启动Activity。为了使后堆栈按我需要的方式工作,我需要将FLAG_ACTIVITY_CLEAR_TOP标志传递给Intent,它工作正常。但是为了给人一种信息正在刷新Activity中的信息而不是完全重新启动它的错觉,我还需要添加标志FLAG_ACTIVITY_NO_ANIMATION。到目前为止,我还不能让这两个标志一起工作。我试过以下方法:theIntent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION+Intent.FLAG_

android - java.lang.SecurityException : Permission Denial: not allowed to send broadcast android. intent.action.MEDIA_MOUNTED 仅在 KitKat 上

我正在使用DownloadManager从我们的服务器下载图像,并将文件放在externalFilesDir中。我正在发送广播Intent,因为我不希望这些下载的图像出现在图库中。sendBroadcast(newIntent(Intent.ACTION_MEDIA_MOUNTED,Uri.parse("file://"+context.getExternalFilesDir(null))));我之前只在我的GalaxyS3JellyBean4.3上测试过它并且它可以工作,但是当我在KitKat4.4上测试它时,它会导致应用程序崩溃。有没有更好的方法使从DownloadManager下

android - 日历 Intent 字段标题/描述在摩托罗拉 Xoom Honeycomb 3.1 和 Acer Iconia 中不起作用

我正在开发一个通过Intent将数据发送到Android日历的应用程序。它与从2.1到2.3.4的默认android日历以及Jorte或BusinessCalender等第3方日历完美搭配。但是对于Honeycomb(AcerIconia和MotorolaXoom),我没有在该领域获得任何标题和描述。我填写了所有通过的字段,年、月、日、小时、分钟,但没有描述和标题GregorianCalendarcal=newGregorianCalendar();Intentintent=newIntent(Intent.ACTION_EDIT);intent.setType("vnd.androi

java - 启动 Intent "silently"

跟进this问题,有没有办法在不提示用户任何操作的情况下在android中启动Intent?现在,我正在检索这样的图像:publicvoidchangeImage(Viewview){Intentintent=newIntent();intent.setType("image/*");intent.setAction(Intent.ACTION_GET_CONTENT);startActivityForResult(Intent.createChooser(intent,getResources().getString(R.string.select_picture)),PICK_IM