android-listview

Android: Start activity from app widget with ListView and Service

浪尽此生 提交于 2019-12-10 11:54:56
问题 I am using a ListView in a App Widget to show some items from a RSS feed. I want to go to a activity of my app if I click on a item in the ListView. I am at the point that I can show a Toast with the clicked position. I want to go to. But I do not know how to start the activity. I need to put my RSSFeed and the position inside the intent which starts the activity. I have a WidgetProvider.java which calls a RemoteFetchService.java in the onUpdate() method. In the OnStartCommand() of this

Android, view Holder does not update listview correctly

蓝咒 提交于 2019-12-10 11:54:35
问题 I'm reading data into my listview from a database and i can see the information in the listview, the data in each row is split into left and right. When i scroll in the listview the items are not uppdating correctly. Some items in the right side off the listview are moving to the left side and the other way around. I can make this problem go away by setting convertView = null directly under the getView() which is a very bad solution! How to solve the problem properly? Code links: Xml "http:/

Deleting checked ListView items

六眼飞鱼酱① 提交于 2019-12-10 11:51:15
问题 I'm trying to delete ListView items that are checked. It works if there is only one item checked but if there are two or three then the app force closes. On the error log it says: E/AndroidRuntime(2173): java.lang.IndexOutOfBoundsException: Invalid location 2, size is 2 When having three items on the list and deleting 2. Can anyone help with correcting this error? Here is the code: public void delete() { btnDelete = (Button) findViewById(R.id.btnDelete); btnDelete.setOnClickListener(new

How to make custom ListView

ぃ、小莉子 提交于 2019-12-10 11:46:27
问题 I've got a TextView and it's getting a list in it. public class Home extends ListActivity { ListView listView; static final String[] Liste = {"a", "b", "c"}; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setTitle("CalcPlus"); listView = getListView(); //Own row layout listView.setAdapter(new ArrayAdapter<String>(this, R.layout.activity_home, R.id.text, Liste)); //listView.setOnItemClickListener(this); } @Override public boolean

swiping items on listview, with small vertical margin

╄→гoц情女王★ 提交于 2019-12-10 11:45:07
问题 So I have a ListView on which I attach : mList.setOnTouchListener(gestureListener); What this gesture listener does is basically measure deltaX (horizontal swipe) and detects if it is higher than some value, then it knows that swipe has occured. Then I have : mList.setOnItemClickListener(new AdapterView.OnItemClickListener() { ... } Which checks with gesture object if swipe has happened, if yes its a swipe, otherwise its a click. All this works fine. My issue is : When I swipe elements with

How get Vertical Button view from xml

倖福魔咒の 提交于 2019-12-10 11:43:58
问题 I want create a Button in Vertically.May be we can by extending a button and re-render(rotate) the canvas to vertical we can get the custom Button. But i need it from xml.check the graphical representation.i need a button like this. 回答1: Please, see link below, there should be solution for your problem http://blog.stylingandroid.com/archives/796 This is tutorial about how to create vertical-textView But because of Button class extends TextView this tutorial should work for Buttons too UPDATE

android - map in listview header

橙三吉。 提交于 2019-12-10 11:32:10
问题 In my app i have an activity which contains a image and a list view at the bottom. Following are the things to be done in the activity. 1. the image view at the top of the page must be of swipe type to show other images. 2. when the list view gets scrolled the image must get moved along with it. 3. in the same activity i have a button, when the button is clicked the image must be switcher over to be a mapview. What i have done is, 1. I have the image view and mapview in view switcher of a

Google Map loading issue in android listview

喜欢而已 提交于 2019-12-10 10:45:12
问题 I am trying to show mapview on my listview. Map cannot load in listview. If i touch the map view, map will load. If i scroll the listview mapview goes to unloaded initial stage. My listview adapter and screenshots are given, public class OfferListAdapter extends BaseAdapter { String lat="",lon=""; String adId; Context context; MapView mapView; GoogleMap map; Util g; ArrayList<HashMap<String, String>> adList; Bundle savedInstanceState; public OfferListAdapter(final Context context, final

ListView Reorder Items

别说谁变了你拦得住时间么 提交于 2019-12-10 10:33:33
问题 I tried to look answers but I couldn't find any. So I want to change my ListView items order in app and I don't have any idea how to do that. I guess Drag and Drop is too hard to build but how about some arrow buttons where you can press up and item move one row up? And how to make app to remember order that next time I open it every item are in order where I moved them? I have my ListView Items in their own file (values->arrays.xml). And here is my ListView activity: public class MainScreen

Reverse the order of ListView display

ε祈祈猫儿з 提交于 2019-12-10 10:31:19
问题 I have a SimpleCursorAdapter to retrieve information from a SQLite database and put it into a ListView. It's all textbook stuff: new SimpleCursorAdapter(this, R.layout.viewexisting, c, from, to); However, I would love for it to display the data in reverse. At the moment the oldest entry in the database appears at the top, and the newest appears at the bottom. 回答1: The order of a list is dependent on how you structure your SQL Query. Specifically one that impacts this exactly is the Sort