草庐IT

scrape-it

全部标签

安卓 5( Lollipop ): Is it possible to make the Background of a Notification transparent?

有什么方法可以让Android中的通知背景透明吗?我通过将RemoteViews与Layout和NotificationCompat结合使用来创建通知:RemoteViewsrv=newRemoteViews(getPackageName(),R.layout.notification_layout);NotificationCompat.BuildermBuilder=newNotificationCompat.Builder(this).setSmallIcon(R.drawable.ic_launcher).setContent(rv);布局的LinearLayout的背景设置为

Javascript : Identify whether it is a desktop Linux or Android

无法使用navigator.userAgent或navigator.platform识别它是linux台式机还是android设备,因为某些android设备有字符串linux在两者中。详情如下DeviceOSnavigator.platform--------------------------------------------------------------------SamsungGalaxyS3Android4.3Linuxarmv7lHTCOneAndroid4.4.2Linuxarmv7lSonyXperiaZAndroid4.2.2Linuxarmv7lMotoro

android - 在实现项目时我面临这个 "Your project contains C++ files but it is not using a supported native build system."

关闭。这个问题需要detailsorclarity.它目前不接受答案。想改进这个问题吗?通过editingthispost添加细节并澄清问题.关闭6年前。Improvethisquestion错误:任务':app:compileDebugNdk'执行失败。Error:YourprojectcontainsC++filesbutitisnotusingasupportednativebuildsystem.ConsiderusingCMakeorndk-buildintegrationwiththestableAndroidGradleplugin:https://developer.a

android - 适用于 Android 的 Docker 容器 : Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)

我正在尝试在Docker容器上构建android,我每次都会遇到此错误./gradlewassembleDebug:saltside-android:transformClassesWithDexForBikroyDebugThemessagereceivedfromthedaemonindicatesthatthedaemonhasdisappeared.Buildrequestsent:BuildAndStop{id=81f2e456-bb5b-4cf8-9190-3c8b22e286b6.1,currentDir=/app/project-main}Attemptingtorea

android - 从不同的包访问数据库 : It give error : android. database.sqlite.SQLiteException: 无法打开数据库文件

我有两个不同的应用程序1.databaseSetup应用--database.apk2.销售应用--salesApp.apk我之所以这样是因为如果数据库损坏了,只需要重新安装数据库。那时不需要安装应用程序。数据库设置应用程序包/data/data/com.xont.app/databases/销售应用程序包-com.xont.controller我想从不同的包访问数据库。这意味着销售应用程序包是com.xont.controller&数据库包是/data/data/com.xont.app/databases/。是否可以通过不同的应用程序访问此文件夹?对于这个问题,我从我的一位frie

android - 禁用 Lint 警告 "The view name suggests this is a number but it does not include a numeric inputType"

我在Lint错误检查首选项中搜索了警告列表,但找不到。列表有点长,无法检查每个警告是否是我想要的,并用name、number、numeric过滤警告>、inputType等不会引发警告。将鼠标悬停在警告上似乎不会提供警告ID。我有充分的理由为名称中带有数字的变量使用文本inputType,这是因为我想登录到使用数字作为登录ID的服务器,因此我需要数字作为字符串。我真的不喜欢那里有警告,如果可能的话,我想禁用该特定警告。谢谢。 最佳答案 您也可以在XML中执行此操作,方法是将xmlns:tools="http://schemas.an

android - Android Studio 中的 Kotlin 构建错误 << intent.putExtra ("string", it.getString ("string") >>

我无法弄清楚下面这段代码有什么问题。在我看来getString必然返回一个字符串。事实上,它适用于上面的行!这是错误吗?funloadExtraBundleIntoIntent(origIntent:Intent,resultIntent:Intent){origIntent.extras?.let{if(it.getString("peerUid")!=null){resultIntent.putExtra("fragment","ChatFragment")resultIntent.putExtra("peerUid",it.getString("peerUid"))}elseif

java - "Header" View 和按钮 : how do I attach listeners to Buttons in a "header" that does not have its own Activity?

我已经谈到了这个问题here,Christopher对此给出了答案,但我不太明白,所以我认为是时候把它变成一个真正的问题,而不仅仅是一个“跟进”=)就目前而言,我正在编写的应用程序有4个不同的屏幕:屏幕1-节点列表(主屏幕)屏幕2-选项菜单,带按钮的tableLayout屏幕3-导航屏幕4-版本等的文本详细信息可以使用放置在顶部的“标题”View来导航这些屏幕。然后标题有4个不同的按钮:+--------------------+|menuwithbuttons|+--------------------+|||||||CONTENT|||||||+------------------

android - 布局 : how to make image to change its width and height proportionally?

我有这样的布局:这个布局几乎满足了我的需要:它使ImageView的高度与TextView的高度相同。图像图形内容拉伸(stretch)也保持纵横比。但是,ImageView的宽度不会改变!结果,我在文本和ImageView之间有很大的差距!作为临时解决方案,我覆盖了View#onLayout。问题:如何在xml布局中改变图片宽度?更新:这是我需要的最终布局(文本+一些图像)。查看第一张图片:它的宽度应该与其中缩放后的图片完全相同,没有填充和边距: 最佳答案 对于imageView,您可以将图像添加到线性布局并赋予权重属性。例如,如

android - 尝试捕捉 : Is it OK to leave applications with handled exceptions?

我对编程还很陌生,所以有些东西我是通过观察学到的,但还没有完全理解。Try-Catch就是其中之一。根据我的研究,try语句允许我定义一个代码块来测试错误,而catch语句允许我定义一个代码块,如果tryblock中发生错误则执行。我明白了。我曾尝试在收到导致应用程序崩溃的异常错误的情况下使用Try-Catch。Try-Catch似乎可以防止(停止)崩溃。但这是我的问题,有一个不断捕获异常错误的应用程序可以吗?例如,我正在使用EditText小部件。我希望EditText的输入值代表货币,所以我应用了android:inputType="numberDecimal"。我从中了解到的问题