When an item in my ListView is clicked, I have several options pop up in a dialog for the user to choose. However, there are varying scenarios where I'd like to disable one or more options so the user cannot choose them. Here's some code.
public class MyApp extends ListActivity implements OnItemClickListener, OnItemLongClickListener {
...
I have a ListView, checkboxes = true, View = List. On the start of the project, I go through, do some calculatations and determine if the database is empty and what I should do from there. Well one thing I do is iterate through an array (from a dll) of Report Names and add the list view items to the ListView because we want it to be as...
I have a ListView with a bunch of ListItem's. When the user selects an item, I would like to change that ListItem's background to an image. How can I accomplish this?
listView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> a, View v, int position, long id) {
// how do I ch...
I have a ListView. When I click on a ListItem, I set the background of the ListItem (it's view) to another color:
listView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> a, View v, int position, long id) {
setupDetailView(position)...
I have a ListViewItem with a custom gradient background. The default selector no longer highlights these rows anymore. Highlight only works if I set the background to transparent. How can I get the highlight?
<ListView android:id="@+id/symbolsListView"
android:layout_width="fill_parent" android:background="@drawable/transparent_...
I have the following ListView, and have followed the answer from this SO Question w/ no luck:
http://stackoverflow.com/questions/2038040/android-listview-selector-color
<ListView android:layout_width="fill_parent"
android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"
and...
When my ListViewItem is highlighted, I want the text to turn white. How can I define this?
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:color="@color/testcolor1"/>
<item android:state_pressed="true" android:state_enabled="false" android:color="@color/testcolor2...
I have a ListView which is populated using a CursorAdapter. I'd also like to have some separators in my ListView. I have accomplished this with an ArrayAdapter, but I'm not sure how to accomplish this with a CursorAdapter. Are there any strategies for doing so? Or am I out of luck?
...
First of all I'm new to Anroid. So it might be a very simple question but I couldn't find the answer by myself.
I have two Activity, I'm filling the first one with the user names and the other data I receive from the remote request and the second one is being used to display the details of the selected user.
So in some way I need to as...
Hi,
An activity has a Button and a ListView.
Initially, only the Button is visible. When the button is pressed, the ListView is displayed.
When displayed, is it possible for me to show one particular item as selected/focussed?
A use case could be that suppose it is a list of language settings and when the list opens, the currently sel...
Hello, the problem is probably simple, the post is longer than I wished, but I've tried providing as much info and detail as possible.
I didn't write this GUI app, nor designed, however like most of us I've inherited it.
It had a (regular) ListView, actually the app has several ListView(s), not sure if that matters yet.
Because the # o...
Hi,
This is my problem.
I have a ListView, each row is a CheckedTextView.
The list view items are "1", "2" and "3".
When a ListItem is clicked, I want to read the number and assign it to an int variable.
I did the following to read the Text of the clicked item:
onItemClick(AdapterView<?> parent, View v, int position, long id) { ...
I have a custom listview row that contains a number of textView components. Instead of the "standard" single text item, I have created a item where each listview row contains several bits of information. For this example, I have a record id, a name, and a description for each row in the listview.
I have my listview populated via
thi...
I am using a listview with 6 items per page. When I choose an item from the 6 items it should take me to a page with 3 items per page BUT the selected item (on previous page) as FIRST item in the list on the new page. Basically how do I set which items shows first in the listview? Is that a property?
...
I'm trying to switch between 2 templates on the basis of a data trigger. But I app crashes with the "Object reference not set to an instance of an object." If I comment out the setter for the template it runs fine.
Here's my XAML:
<Style x:Key="ListViewItemStyle" TargetType="{x:Type ListViewItem}">
<Setter Property="Template" V...
I have tried to remove specific items from a listview using the RemoveAt() method. But When I remove it the first time some items will stay.
For example: see the image below
Code:
private void button1_Click(object sender, EventArgs e)
{
for (int i = 0; i < listView1.Items.Count; i++)
{
if (listView...
I had a regular Forms.ListView and converted it to Virtual list. Implemented the RetrieveVirtualItem and everything was working fine.
Then I decided that I'll add cache and eventually I'll need sorting and who knows what else. Since I've inherited the code and it was already somewhat messy, I decided to yank my changes and move them to ...