草庐IT

set_charset

全部标签

android.Settings.Secure.ANDROID_ID

我正在开发一个android应用程序,我将使用LVL库来检查googleplay许可证。阅读LVL文档后,我了解到我必须获取android.Settings.Secure.ANDROID_ID才能混淆googleplay响应。但我还读到,从TelephonyManager获得的ANDROID_ID有时对于不同的设备是相同的。First,itisnot100%reliableonreleasesofAndroidpriorto2.2(“Froyo”).Also,therehasbeenatleastonewidely-observedbuginapopularhandsetfromama

android - 试图画一个按钮 : how to set a stroke color and how to "align" a gradient to the bottom without knowing the height?

我正在以编程方式创建一个按钮。它是圆形的,具有渐变背景,工作正常,看起来也不错,但我无法做我想做的两件事:设置具有给定颜色的1像素笔划。我尝试了getPaint().setStroke(),但不知道如何设置描边颜色。我应该怎么做?将渐变与按钮的底部对齐,无论它的高度是多少。这可能吗?作为引用,这是我正在使用的代码:Buttonbtn=newButton(context);btn.setPadding(7,3,7,5);btn.setTextColor(text_color);//Createagradientforthebutton.Heightishardcodedto30(Idon

android - Action 条 Sherlock : Setting and hiding title bar

我是ActionBarSherlock的新手,有两个问题:首先,我只想能够设置操作栏的标题,但是当我这样调用它时它不起作用:finalActionBaractionBar=(ActionBar)findViewById(R.id.actionBar);actionBar.setTitle("testtitle");相应的xml对象如下所示:(这是根据github示例建模的:https://github.com/johannilsson/android-actionbar/blob/master/actionbarexample/src/com/markupartist/android/

android - 改造 2 : How to set individual timeouts on specific requests?

我通过以下方式在我的Retrofit适配器中设置了全局超时OkHttpClientokHttpClient=newOkHttpClient();okHttpClient.setReadTimeout(20,TimeUnit.SECONDS);okHttpClient.setConnectTimeout(20,TimeUnit.SECONDS);retrofit=newRetrofit.Builder().client(okHttpClient).build();太棒了!但我想为某些请求设置一个特定的超时例如publicinterfaceMyAPI{@GET()CallnotImport

android - Dagger2 错误 : Module Must Be Set

我试图在Dagger2中进行子范围划分。但是,我无法找出此编译错误:->...MyApplicationModulemustbeset这发生在我的LogInFragment中。如果有人会尝试阐明此错误。我真的很高兴。这是我的应用程序类:publicclassMyApplicationextendsApplication{@OverridepublicvoidonCreate(){super.onCreate();MyInjector.initialize(this);}}这是MyInjector类:publicenumMyInjector{INSTANCE;MyApplicationC

android - 非法状态异常 : Link does not have a NavController set

我正在使用Android导航组件进行导航。我有一个LoginFragment,它有一个按钮可以转换到SignUpFragment。单击按钮时出现此错误。java.lang.IllegalStateException:Viewandroid.support.v7.widget.AppCompatButton{49d9bd1VFED..C.....P....201,917-782,1061#7f090172app:id/signUpLink}doesnothaveaNavControllerset这是我的nav_graph.xml这是用于导航的LoginFragment中的代码-bindi

安卓 : set TextView style at runtime

有没有人知道如何在运行时为TextView设置样式:像这样的myTextView.setStyle(R.style.mystyle); 最佳答案 非常简单,只需使用setTextApparence和您的样式myTextView.setTextAppearance(getApplicationContext(),R.style.boldText); 关于安卓:setTextViewstyleatruntime,我们在StackOverflow上找到一个类似的问题:

安卓 + Gradle : Best place to set dynamic archivesBaseName

在我们的Android项目中,我们希望APK的文件名包含日期、git分支名称和短提交哈希等信息。我们一直将此设置为defaultConfig的一部分android{defaultConfig{setProperty("archivesBaseName","$projectName.$branchName.$date.$buildNumber.$versionCode-$versionName-$versionSha")}}这在大多数情况下都有效,但我们的构建有时会失败,错误指向过时的值(例如在切换分支之后)。在AndroidStudio中强制执行GradleSync通常可以解决这个问题

android - Settings.Secure.HTTP_PROXY 在 ICS 中已弃用,但没有关于替换的信息

Android开发者文档对Settings.Secure.HTTP_PROXY的描述如下:Hostnameandportforglobalhttpproxy.Uses':'seperatorforbetweenhostandportTODO-deprecateinfavorofglobal_http_proxy_host,etc但是没有关于global_http_proxy_host的任何信息。现在我在尝试读取Settings.Secure.HTTP_PROXY时总是得到null。Settings.Secure.HTTP_PROXY在ICS之前的所有版本中都能正常工作。

android - 可折叠工具栏 : Set how much the toolbar should be collapsed in onCreate

我正在创建一个ListView及其相应的DetailView应用程序。我的ListView包含一些项目,如果单击这些项目,用户会转到DetailViewActivity。在DetailViewActivity上,我实现了一个可折叠工具栏。现在,每次打开DetailViewActivity时,都会在可折叠工具栏内的ImageView上设置不同的图像(具有不同的尺寸)。我希望Toolbar应该默认打开到一定高度(比如256dp),但是如果图像高度大于那个高度,用户应该能够下拉查看图像的其余部分。(就像Whatsapp一样)每次打开Activity时,我都成功地以编程方式设置了Toolbar