草庐IT

gallery-item

全部标签

android - Google Photos 与 Stock Gallery - Intent Picker

在我的应用中,我允许用户从他们的图库中选择个人资料图片,如下所示:当你点击第一个选项时,在我的Android5.0设备上,我得到了这个:如果我使用基于AOSP项目的普通Gallery应用程序,一切都会正常运行。但是,照片的应用似乎使用了不同的Intent。以下是我处理普通画廊代码的方式:IntentphotoPickerIntent=newIntent(Intent.ACTION_PICK,android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);photoPickerIntent.setType("image/*")

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 Gallery 纯文本

我查看了API演示,他们有一个画廊示例,其中仅显示文本,代码仅使用Cursor,但我想使用String数组。我怎样才能实现使用它?这是API演示中示例的代码:Cursorc=getContentResolver().query(People.CONTENT_URI,null,null,null,null);startManagingCursor(c);SpinnerAdapteradapter=newSimpleCursorAdapter(this,//Useatemplatethatdisplaysatextviewandroid.R.layout.simple_gallery_it

android - 在 Android Gallery App 中创建自定义相册

我想在Android中创建一个新的“相册”。我不明白你必须用你自己的ContentProvider来做。但我无法弄清楚如何。如果您拍照,所有图像都会出现在“相机”相册中。如果您安装了Google+,您会看到2个额外的相册:即时上传和个人资料照片。我们想创造类似的东西。我们在网上为每个用户创建了一个相册,我们希望它在相册应用中显示为一个相册项。有人能指出我正确的方向吗。我已经检查过:http://developer.android.com/guide/topics/providers/content-providers.html实际上我不确定这是否可能。 最佳

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