草庐IT

touch-action

全部标签

android - 如何检测用户何时在 android 设备上插入耳机? (与 ACTION_AUDIO_BECOMING_NOISY 相反)

我正在开发一个具有以下必要条件的应用程序:如果设备中插入了耳机并且用户将其移除,我需要将所有流静音。为此,我需要收听AudioManager.ACTION_AUDIO_BECOMING_NOISY广播。还行吧!这里没问题。但是当用户再次插入耳机时,我需要取消设备静音。但是没有AudioManager.ACTION_AUDIO_BECOMING_NOISY对面广播。我不知道耳机何时重新插入。一种解决方案是定期查看AudioManager.isWiredHeadsetOn()是否为true但这对我来说似乎不是一个好的解决方案。有没有办法检测用户何时将耳机插入设备?已编辑:我尝试以这种方式使

android - 自定义 Android Intent.ACTION_SEND

我正在使用Intent来共享url和主题。在此Intent过滤器中显示所有共享应用程序。我只想要(facebook/gmail/message/skype/twitter)弹出窗口中的这些选项。是否可以自定义共享Intent过滤器。IntentsharingIntent=newIntent(android.content.Intent.ACTION_SEND);sharingIntent.setType("text/plain");StringshareBody=adapter.getDetails("url";sharingIntent.putExtra(android.conten

android - 自定义 Android Intent.ACTION_SEND

我正在使用Intent来共享url和主题。在此Intent过滤器中显示所有共享应用程序。我只想要(facebook/gmail/message/skype/twitter)弹出窗口中的这些选项。是否可以自定义共享Intent过滤器。IntentsharingIntent=newIntent(android.content.Intent.ACTION_SEND);sharingIntent.setType("text/plain");StringshareBody=adapter.getDetails("url";sharingIntent.putExtra(android.conten

android - 渲染期间引发异常 : Unable to find the layout for Action Bar

刚才使用AndroidStudio时,我正在编辑器中编辑XML文件,但在预览和设计窗口中出现此错误:Exceptionraisedduringrendering:UnabletofindthelayoutforActionBar.我尝试重新启动AndroidStudio、我的笔记本电脑和谷歌搜索答案,但我找不到任何东西。有没有人经历过类似的事情? 最佳答案 我遇到了这种错误。在我的Mac上,有API22。如果我选​​择它,就会出现这个错误。所以点击API21或更低版本可以解决您的问题您可能需要更新您的工具

android - 渲染期间引发异常 : Unable to find the layout for Action Bar

刚才使用AndroidStudio时,我正在编辑器中编辑XML文件,但在预览和设计窗口中出现此错误:Exceptionraisedduringrendering:UnabletofindthelayoutforActionBar.我尝试重新启动AndroidStudio、我的笔记本电脑和谷歌搜索答案,但我找不到任何东西。有没有人经历过类似的事情? 最佳答案 我遇到了这种错误。在我的Mac上,有API22。如果我选​​择它,就会出现这个错误。所以点击API21或更低版本可以解决您的问题您可能需要更新您的工具

android - DownloadManager.ACTION_DOWNLOAD_COMPLETE 广播接收器在 Android 中多次接收相同的下载 ID,但下载状态不同

我正在使用AndroidDownloadMangerSystemService通过以下方式下载一些文件dwnId=mgr.enqueue(newDownloadManager.Request(serveruri).setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI|DownloadManager.Request.NETWORK_MOBILE).setAllowedOverRoaming(false).setTitle(getAlbumName()).setDescription(getTrackName()).setD

android - DownloadManager.ACTION_DOWNLOAD_COMPLETE 广播接收器在 Android 中多次接收相同的下载 ID,但下载状态不同

我正在使用AndroidDownloadMangerSystemService通过以下方式下载一些文件dwnId=mgr.enqueue(newDownloadManager.Request(serveruri).setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI|DownloadManager.Request.NETWORK_MOBILE).setAllowedOverRoaming(false).setTitle(getAlbumName()).setDescription(getTrackName()).setD

android - 如何正确触发 ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS Intent ?

如文档中所述:"AnappholdingtheREQUEST_IGNORE_BATTERY_OPTIMIZATIONSpermissioncantriggerasystemdialogtolettheuseraddtheapptothewhitelistdirectly,withoutgoingtosettings.TheappfiresaACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONSIntenttotriggerthedialog."有人能告诉我触发这个Intent的正确方法吗? 最佳答案

android - 如何正确触发 ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS Intent ?

如文档中所述:"AnappholdingtheREQUEST_IGNORE_BATTERY_OPTIMIZATIONSpermissioncantriggerasystemdialogtolettheuseraddtheapptothewhitelistdirectly,withoutgoingtosettings.TheappfiresaACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONSIntenttotriggerthedialog."有人能告诉我触发这个Intent的正确方法吗? 最佳答案

android - 违反 Google Play 开发者政策的警告 : Action Required

我最近收到了许多来自google的邮件,内容涉及我的许多应用。邮件内容是:HelloGooglePlayDeveloper,Ourrecordsshowthatyourapp,XXXX,withpackagenamecom.XXXX.XXXXXXXXXX,currentlyviolatesourUserDatapolicyregardingPersonalandSensitiveInformation.Policyissue:GooglePlayrequiresdeveloperstoprovideavalidprivacypolicywhentheapprequestsorhandl