草庐IT

ommerce-toolbox-plugins-and-theme

全部标签

安卓 WebView : detect long press on <a> and <img>

有没有办法检测对WebView内的链接和图像的长按? 最佳答案 我查看了Browser.apk源代码并找到了我真正要找的东西:publicvoidonCreate(BundlesavedInstanceState){//...registerForContextMenu(descriptionWebView);//...}publicvoidonCreateContextMenu(ContextMenumenu,Viewview,ContextMenu.ContextMenuInfomenuInfo){WebView.HitTest

android - 如何在默认主题 Theme.Holo.Light 中更改 homeAsUpIndicator 的图像

在我的安卓应用中,我使用的是默认主题Theme.Holo.Light。现在我想更改默认使用的“@android:drawable/ic_ab_back_holo_light通过将其更改为@drawable/ic_launcher但这里的标志保持原样,它不会改变图像。我附上了actionBar的屏幕截图。任何帮助将不胜感激。 最佳答案 将它们放入您的默认Activity主题中。@drawable/ic_launcher 关于android-如何在默认主题Theme.Holo.Light中更

安卓 map : difference between OnMapReady() and OnMapLoaded()

谁能解释一下OnMapReadyCallback.OnMapReady(GoogleMapgoogleMap)和GoogleMap.OnMapLoadedCallback.OnMapLoaded()我不是很清楚。 最佳答案 这基本上取决于您要对map执行的操作。您可以安全地使用OnMapReadyCallback来设置您的图钉等。一旦map准备好供您使用,它就会被调用。OnMapLoadedCallback,如文档所述,被调用Whenthemaphasfinishedrendering.Thisoccursafteralltiles

android - 警告 : API 'variant.getMergeResources()' is obsolete and has been replaced with 'variant.getMergeResourcesProvider()'

我每次构建我的应用程序时都会收到此警告。我想我有所有的库更新,有人可以告诉我问题出在哪里吗?显然,我认为这可能来自GooglePlay服务,但我拥有我正在使用的所有库的最新版本。我找不到任何可以解决问题的方法WARNING:API'variant.getMergeResources()'isobsoleteandhasbeenreplacedwith'variant.getMergeResourcesProvider()'.Itwillberemovedattheendof2019.Formoreinformation,seehttps://d.android.com/r/tools/

java - 检索项目 : No resource found that matches the given name '@android:style/Theme.AppCompat.Light.DarkActionBar' 的父项时出错

我正在关注来自developers.android.com的android开发教程,目前我正在尝试使用此处提供的信息来设置操作栏的样式:https://developer.android.com/training/basics/actionbar/styling.html#CustomBackground7这是res/values/themes.xml的代码:@style/MyActionBar@style/MyActionBar@drawable/actionbar_background@drawable/actionbar_background我在“style”开始标签旁边看到红叉

android - 错误 : IllegalArgumentException: The style on this component requires your app theme to be Theme. Material 组件

下面是我的依赖implementation'com.google.android.material:material:1.0.0'implementation'androidx.appcompat:appcompat:1.0.2'implementation'androidx.constraintlayout:constraintlayout:1.1.3'我的layout.xml上面的代码对我来说工作正常但是当我更新materialdesign的dependenciesimplementation'com.google.android.material:material:1.1.0-a

android:theme ="@android:style/Theme.NoTitleBar.Fullscreen"安卓不工作

我在list文件中声明我的Activity,如下所示。我声明了全屏主题的Activity。但它不起作用。我也使用第二种全屏方式,如下所示。requestWindowFeature(Window.FEATURE_NO_TITLE);getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);但是没有成功。请帮我找到这个。 最佳答案 我通过在应用程序级别声明全屏主题来解决它。

android - 如何解决警告 : You are installing software that contain unsigned content and authenticity and validity of this software can not established

我是Android新手。我安装了EclipseKepler版本。我点击了这个链接。https://sites.google.com/site/barsham/list-of-topics-1/programming/eclipse-android-windows-64完成以下步骤后:6.1。启动Eclipse,然后选择帮助>安装新软件....6.2点击右上角的添加。6.3在出现的“添加存储库”对话框中,为名称输入“ADT插件”,为位置输入以下URL:https://dl-ssl.google.com/android/eclipse/我尝试了https和httpurl。但弹出相同的错误框

android - java.lang.IllegalStateException : TimerTask is scheduled already: Rationally using of Timer and TimerTask in Android 错误

我编写了一个连接到服务器并向他发送ping命令的应用程序,服务器使用pong命令进行应答。我想实现连接超时机制。我认为它将如下:客户端发送ping并使用timertask和delay启动计时器当客户端收到pong时,timertask被取消。另外,我想优化内存。所以,不要在我每次发送ping命令时都重新创建TimerTask。我尝试下面的代码:privatefinalTimermSystemLogoutTimer=newTimer();privatefinalTimerTaskmLogoutTask=newTimerTask(){@Overridepublicvoidrun(){mMe

android - 下载管理器 : understand retry policy and error codes

根据documentation,如果下载因http错误而失败-COLUMN_REASON应包含特定的http错误代码。我遇到的问题是,在实践中,下载失败时我看到的唯一原因值是ERROR_HTTP_DATA_ERROR此外,我在logcat中看到运行时实际失败的http代码,当下载停止并重试时,但我看不到任何从下载管理器获取它的方法。是否有可能以某种方式获得此http代码?我正在使用广播接收器来处理ACTION_DOWNLOAD_COMPLETE,但我没有看到任何方式来听取暂停的下载,而且我感觉如果我在重试尝试之间查询下载管理器失败原因-那么我将获得实际状态代码。是否可以在不不断查询下载