android-listview

ListView doesn't listen to onClick

我的梦境 提交于 2019-12-12 02:46:44
问题 I'm trying to do a ListView that it can refresh when i call the function actualizarDisplay(). I've seen in the log cat a message, and i have doubts abaout that message: 10-06 12:24:02.524: I/dalvikvm(6911): Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.internal.widget.TintTypedArray.getType 10-06 12:24:02.524: W/dalvikvm(6911): VFY: unable to resolve virtual method 561: Landroid/content/res/TypedArray;.getType (I)I 10-06 12:24:02.524:

How to delete list view items (when list is populated by SharedPreferences

若如初见. 提交于 2019-12-12 02:45:18
问题 I have a list view successfully being populated by SharedPreferences. public class FavouritesActivity extends Activity { ArrayAdapter<String> adapter; List<String> List; private ListView lv; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_my_favourites); lv = (ListView) findViewById(R.id.My_Favourites); SharedPreferences preferences = this.getSharedPreferences("MyPreferences", Context.MODE_PRIVATE); ArrayList

ListView not showing up in fragment

こ雲淡風輕ζ 提交于 2019-12-12 02:42:00
问题 When I insert a listview in a fragment in my application, it doesn't show up after I populate it with items. In fact, the application crashes due to a NullPointerException. Can anybody help me? Here is the detail activity from which I show the fragments. package com.example.sample; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentTransaction; import android.support.v4.app.NavUtils; import android.widget

Android search list invisible by default? Can it be done?

天涯浪子 提交于 2019-12-12 02:27:23
问题 Hi guys I have a question: In short, I have a listview, with a searchbar on top of it, I am also able to start my other activities after filtering the results etc; basically everything works fine and sweet. My question is this: When launching the main activity the listview is visible (obviously enough). Is there a way to make the listview invisible and only after typing in the searchbar to make the results of the listview become visible? Something like an in app search thing; or am I just

Match background color of listview row Espresso

柔情痞子 提交于 2019-12-12 02:25:49
问题 I have a ListView with rows of different colors created through a custom adapter like: @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder; convertView = mInflater.inflate(R.layout.row_unit, parent, false); // ... if( /* some condition */ ) { convertView.setBackgroundColor(Color.LTGRAY); } else { convertView.setBackgroundColor(Color.WHITE); } return convertView; } In a test, I would like to check whether a certain element in the list has Color

How to set OnitemClick in custom listview

别说谁变了你拦得住时间么 提交于 2019-12-12 02:23:33
问题 I created a listview using listview adapter that extends base adapter. It works fine. but I need to add onitemClick Listener to listview, when I click a list item it go to another activity ,along with the listitem.how can we do this ? This is my code in the listview adapter public class listviewAdapter extends BaseAdapter{ String FIRST_COLUMN = Constant.FIRST_COLUMN; String SECOND_COLUMN = Constant.SECOND_COLUMN; String THIRD_COLUMN = Constant.THIRD_COLUMN; String FOURTH_COLUMN = Constant

swapCursor(Cursor) is undefined for the type SimpleCursorAdapter

那年仲夏 提交于 2019-12-12 02:23:03
问题 I am receiving a "swapCursor(Cursor) is undefined" error when creating a CursorLoader. I have imported the android.support.v4 (app.LoaderManager, app.LoaderManager.Loader, Content.CursorLoader, content.Loader). Not sure what I can do to correct this issue. please advise. loader: import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android.support.v4.app.LoaderManager; import android.support.v4.content.CursorLoader; import android.support.v4.content

TouchListView is not working when parent activity finishes

左心房为你撑大大i 提交于 2019-12-12 02:22:49
问题 I'm using a TouchListView by CommonWare and so far it's working fine, But it fails in the following case: activity A has a TouchListView and button to add an item , now when i click over a button, activity B opens up and once the user choose the item i am calling finish to end activity B and it comes back to activity A . Now here drag n drop in TouchListView doesn't work I mean items are getting dragged but not able to be placed where a user wants, I tried a lot but could not find a way to

i have android app that retrieve data from sqlite and display the data in BaseAdapter .. what is the best way ??

谁都会走 提交于 2019-12-12 02:22:47
问题 i have an android application that retrieve data from sqlite database and display these data in a listView that extend a BaseAdapter. in this app i have images in the drawable folder and i have in the sqlite a field that contain name of these images. my question is how to retrieve these data and display it in a listView ?? i read this tutorial :(http://www.androidhub4you.com/2012/09/hello-friends-today-i-am-going-to-share.html). my question is there any other way to do this ?? i will

MvxListView in Android with MvvmCross

我怕爱的太早我们不能终老 提交于 2019-12-12 02:17:17
问题 I'm using MvvmCross v3 and I have a little problem with list in Android. I actually have a Mvx.MvxListView who works well, but I'm working on tablet, and ListView is a little bit inapropriate. So I want to have a control like WrapPannel in XAML to have more than one item in a row. How can I have this kind of control? Thanks 回答1: There are two challenges here: 1. Find or make the control you want The first is really up to you and your UX/design team to do - although people might be able to