草庐IT

current_item

全部标签

java - 通过 XML API 改造阅读列表<Item>

我正在尝试将Retrofit与SimpleXmlConverter结合使用以从我的API读取数据。我的类(class)评论看起来像:@RootclassComment{@ElementprivateStringtext;}我想从XML中读取评论列表:sampletextsampletext在我的界面中有一个方法:@GET("/lastcomments")ArrayListlastComments();但是当我调用lastComments()改造抛出:Causedby:retrofit.RetrofitError:java.lang.ClassCastException:libcore.

android - 数据绑定(bind) RecyclerView : Cannot find the setter for attribute 'app:items'

当我尝试竞标RecyclerView时出现此错误Error:(15,22)Cannotfindthesetterforattribute'app:items'withparametertypeandroid.databinding.ObservableArrayListonandroid.support.v7.widget.RecyclerView.这是我的代码:但是在UsersViewModel我已经有一个公共(public)用户数组packagecom.toong.databindingdemo.recycler;importandroid.databinding.BaseObse

Android: Horizo​​ntalScrollView in a ListView row Item, focus issue

我有一个ListView,每个项目都有一个包含Horizo​​ntalScrollView的布局。问题是,当用户单击或触摸列表项时,我无法让整个列表项成为焦点。我该如何解决这个问题?谢谢编辑:Horizo​​ntalScrollView看起来像这样: 最佳答案 好的,伙计们,我知道了。在LinearLayout包装我的Horizo​​ntalScrollView我添加了以下属性:android:descendantFocusability="blocksDescendants"所以Horizo​​ntalScrollView没有获得

android - 错误 : x86 emulation currently requires hardware acceleration!(安卓工作室)

我目前的AndroidStudio有问题,因为我无法使用模拟器运行任何应用程序。尝试运行应用程序时出现的完整错误是......Emulator:emulator:ERROR:x86emulationcurrentlyrequireshardwareacceleration!Emulator:Processfinishedwithexitcode1我已经完全安装了IntelHaxm(当运行intelhaxm-android.exe时它只给我删除的选项)并尝试使用API27和28。任何帮助将不胜感激:) 最佳答案 我遇到了同样的问题。执

android - android_stubs_current_intermediates 目录下的.java 文件是如何生成的?

Android构建过程为android.jar中的每个类生成(?)Javastub,并将它们存储在以下目录中:./out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/src/例如,上述目录的子目录java/lang/中包含java.lang.*类对应的.java文件,子目录`android/app/中包含对应的.java文件到android.app.*类。这些.java文件不包含实际代码,而只是带有虚拟主体的签名。我假设这些.java文件是使用工具从实际源代码生成的。我的问题是,这个工具是什么

Android:simple_list_item_single_choice 不适用于 ArrayAdapter

在我的ListView中,我想通过单选来删除项目。为此,我将simple_list_item_single_choice与ArrayAdapter一起使用。它向我显示了我的ListView中的单选选项。但我无法点击该复选框。这是我的代码:ArrayListarray_list_title=mydb.getTitle();System.out.println(array_list_title);ArrayAdapterarrayAdapter=newArrayAdapter(this,android.R.layout.simple_list_item_single_choice,arra

android - 折叠工具栏布局 : Change menu item icon color when it is expanded

我在我的项目中使用CollapsingToolbarLayout。当CollapsingToolbarLayout展开时,默认情况下它是白色的(即在style.xmlandroid:textColorSecondary中定义)。我的问题:Iwanttochangemymenuitemiconcolor.这是我的代码:xml文件:主要Activity代码:AppBarLayoutappBarLayout=findViewById(R.id.appbar_layout);appBarLayout.addOnOffsetChangedListener(newAppBarLayout.OnOf

android - Android 中的 simple_list_item_2

在使用simple_list_item_1创建了一些菜单(效果很好)后,我尝试用simple_list_item_2替换它,但我的系统抛出异常...现在我想知道如何为我的列表创建这样一个两个不同大小的行条目...初学者有什么陷阱吗?有人可以帮我解决我的(小!?)问题吗?我的代码是这样的:ListAdapterlistAdapter=newArrayAdapter(this,android.R.layout.simple_list_item_2,fileNames);setListAdapter(listAdapter);我的String[]fileNames存储所有要按升序显示的字符串

android - RecyclerView 安卓 : Getting an item at a particular position

有没有办法在适配器外部的特定位置获取RecyclerView的项目。例如在ListView中我们可以这样做:listView.getItem(position);我们可以用RecyclerView做到这一点吗?以及提供的数据列表的顺序是否保持不变? 最佳答案 您可以将自己的方法添加到RecyclerView,或者我建议使用RecyclerView.Adapter本身。例如,对于ListView,您有:@OverridepublicObjectgetItem(intposition){returnlistData.get(positi

android - 为什么我得到 "call to OpenGL ES API with no current context"?

我是openGL和android开发的新手,所以如果我的问题很琐碎,请原谅我。我正在尝试构建一个简单的小应用程序,该应用程序在三个EditText中接受用户的输入,这些EditText表示要在GLSurfaceView中显示的RGB颜色的每个组件的0-100%值。要注意的是,我需要它来使用openGLES2.0,并且我需要使用统一值将数据传递到着色程序,这样一旦我让它工作,我就可以继续我真正想要完成的事情。运行我编写的内容后,我可以让GLSurfaceView正确显示第一个纯色,但是每当我更改任何值并调用重建着色程序中的统一插槽时,我都会在LogCat中收到此错误:错误/libEGL(