草庐IT

re-doing-it-wrong

全部标签

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 - IllegalStateException : attempt to re-open an already-closed object. SimpleCursorAdapter 问题

我是android编程的新手。可以看到这个问题之前已经提过很多次了。但是,我仍然看不出问题是什么。我正在尝试将SQLite数据库中的数据连接到ListView。在ListActivity中,我的onCreate如下所示:publicvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.activity_init_key);getActionBar().setDisplayHomeAsUpEnabled(true);DBHandlerdb=newD

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|||||||+------------------

安卓 2.1 : How do I bring the soft keyboard manually?

我有一个占据屏幕上半部分的表单,我想显示键盘一直在下半区。我该怎么做?(安卓2.1,NexusOne) 最佳答案 如果您想在您的代码中控制软键盘,您可以使用InputMethodManager调用它并关闭它。getSystemService()是对Activity的调用。InputMethodManagerimm=(InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);imm.showSoftInput(activeView,0);

android - Android 上的路标 OAuth : how to re-create the Consumer between two succesive runs?

我成功地使用Signpost通过OAuth授权对Google帐户中protected资源的调用。然而,用户每次都必须通过Google并授予访问权限,这似乎有点奇怪。有没有一种方法可以序列化消费者并重新创建它,这样就不需要重新授权了?我已尝试将token、secret和验证程序保留在共享首选项中并在消费者中进行设置,但我收到了OAuthExpectationFailedException。有什么想法吗? 最佳答案 收到访问token后,您可以将其存储在您的应用首选项中,如下所示:provider.retrieveAccessToken

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

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