listactivity

Android: onListItemClick not getting called in ListActivity

筅森魡賤 提交于 2019-12-23 05:36:14
问题 I'm having problems with my first Android app. I have subclassed ListActivity, and I'm having no luck getting the overridden onListItemClick() to respond to click events. I've read focus can be a problem, but changing focus in the XML files does not seem to work. Here's the relevant bits of code. Anyone see what's I've buggered up? public class Notepadv1 extends ListActivity { private int mNoteNumber = 1; private NotesDbAdapter mDbHelper; @Override public void onCreate(Bundle

class extends ListActivity “whose id attribute is 'android.R.id.list'”

ⅰ亾dé卋堺 提交于 2019-12-22 15:00:18
问题 I'm trying to extend my main Activity to "ListActivity" (previously extends to: Activity) to use onListItemClick, but the logcat, send me "Your content must-have a ListView whose id attribute is 'android.r.id.list'". (i'm using SQLite for populate the ListView). mi xml is: <ListView android:id="@+id/list" // to "@id/android:list" or other styles (but nothing works) android:layout_width="fill_parent" android:layout_height="fill_parent"/> // or closing with </ListView> this is the complete xml

Proper implementation of changing ListView data with CursorAdapter

狂风中的少年 提交于 2019-12-22 08:44:53
问题 I have a ListView populated via a CursorAdapter. I give my user the ability to alter the data in the list. For example, the user can mark a row as being unread (the data are messages). Suppose my user marked a row unread. Would a proper implementation mark the row in the database as read and then requery the Cursor? 回答1: Would a proper implementation mark the row in the database as read and then requery the Cursor? Yes, that's the right answer. The requery() will trigger an automatic update

ListActivity with header and toast selecting wrong list item

人盡茶涼 提交于 2019-12-21 21:51:05
问题 Writing an application Menu.java extending ListActivity and I have added a TextView header at the top above my list activity. The layout of header and list activity are exactly what I want, but when I click on say Item1 the toast pops up and says "Item2" selected. When I click on Item2... "Item3" Selected. But when I click on Item3, the app crashes and displays a bunch of Runtime Errors. It did not do this before I had the header implemented. I have searched and searched stackoverflow and the

Is there a way to update multiple TextView with ArrayAdapter?

醉酒当歌 提交于 2019-12-21 04:20:52
问题 I have a list view that has multiple textview's like this: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical"> <TextView android:id="@+id/name" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textSize="16dip" android:textColor="#000000" android:paddingLeft="10dip" android:textStyle="bold"/> <TextView android:id="@+id/address" android

Changing a divider with setDivider in a ListActivity without a custom ListView?

拈花ヽ惹草 提交于 2019-12-20 09:19:38
问题 I can't seem to get a customized divider, using a Drawable I've defined, to work when using a ListActivity and not creating a custom ListView . It almost seems like when the VM creates its own ListView for me, with the ListActivity , it uses a theme with the default divider provided; and if I try to provide one, no dividers appear in the ListView at all. I know that I can create a custom ListView using XML and define android:divider on that ListView , and this does recognize my custom divider

OnListItemClick event is not working

和自甴很熟 提交于 2019-12-20 07:23:26
问题 I have been facing a problem...there is a five different Java classes MainActivity , Application , ApplicationAdapter , FetchData , FetchDataListener .. I am binding mysql data from api in ListView ... but I am trying to fire a click event on ListView but I am getting error....here is code... MainActivity.Java @Override public void onFetchComplete(List<Application> data) { if(dialog != null) dialog.dismiss(); ApplicationAdapter adapter = new ApplicationAdapter(this, data); setListAdapter

Nested inner Activity class in android

孤者浪人 提交于 2019-12-19 16:55:16
问题 Is declaring a class that extends Activity inside another Activity class possible? If it is, how would I register that class in the manifest? Also, is that something that can be reasonably done or is it a bad idea? I was thinking of something like class ListClass extends ListActivity{ ... ArrayList items; class ItemClass extends Activity{ ... Item item; @Override onCreate(){ Integer pos = getIntent().getExtras().getInt("pos"); item = items.get(pos); } } @Override onItemClick(int position){

Nested inner Activity class in android

∥☆過路亽.° 提交于 2019-12-19 16:54:09
问题 Is declaring a class that extends Activity inside another Activity class possible? If it is, how would I register that class in the manifest? Also, is that something that can be reasonably done or is it a bad idea? I was thinking of something like class ListClass extends ListActivity{ ... ArrayList items; class ItemClass extends Activity{ ... Item item; @Override onCreate(){ Integer pos = getIntent().getExtras().getInt("pos"); item = items.get(pos); } } @Override onItemClick(int position){

How to display picture from web in ListActivity Customer item with SimpleAdapter?

*爱你&永不变心* 提交于 2019-12-19 10:43:12
问题 I Create a Activity Extends ListActivity I can used SimpleAdapter to display R.drawable.picture but I want to display picture from web in CustomerItem How do? List data; List> plan_list; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.plan_list); plan_list = getPlanList(); Plan_SimpleAdapter adapter = new Plan_SimpleAdapter(this, plan_list, R.layout.plan_item, new String[] { "Title", "miaoshu","img" }, new int[] { R.id