listactivity

How to implements a ListFragment into your project from a Sample?

时光毁灭记忆、已成空白 提交于 2020-01-01 20:27:11
问题 I have a Pager adapter that will call a ListFragment like this: public Fragment getItem(int position) { Fragment fragment = new ListViewFragment(); // set arguments here, if required Bundle args = new Bundle(); fragment.setArguments(args); return fragment; Then I have a ListActivity that I want to change to ListViewFragment. public class ImageListActivity extends ListActivity implements RadioGroup.OnCheckedChangeListener { @Override protected void onCreate(Bundle savedInstanceState) { super

How to implements a ListFragment into your project from a Sample?

♀尐吖头ヾ 提交于 2020-01-01 20:26:17
问题 I have a Pager adapter that will call a ListFragment like this: public Fragment getItem(int position) { Fragment fragment = new ListViewFragment(); // set arguments here, if required Bundle args = new Bundle(); fragment.setArguments(args); return fragment; Then I have a ListActivity that I want to change to ListViewFragment. public class ImageListActivity extends ListActivity implements RadioGroup.OnCheckedChangeListener { @Override protected void onCreate(Bundle savedInstanceState) { super

Android: Draw custom border around listview?

為{幸葍}努か 提交于 2020-01-01 14:55:35
问题 I've got a ListActivity with a ListView in it. I need to draw a repeating image around the border ("on top of it (I guess after the listview is renderered)) How can I hook in my own drawing code for this? 回答1: You can use a FrameLayout to cause the ListView to overlap with a view that fills the entire screen. In this background view you could tile an image, or write your own custom View with your own drawing method. 回答2: There is no border property in ListView, as far as I know. Instead you

checkboxes in the List randomly get checked/unchecked when i scroll through. android 2.3

旧城冷巷雨未停 提交于 2020-01-01 07:12:11
问题 I am using my custom adapter. There is a checkbox and a text view in each row. But i have a problem. There are more items in the list than the number which fits on the screen. So when i check any of the checkboxes on the screen and scroll down. The automatically get unchecked. When i scroll up again some random checkboxes get checked. I know that in getView() list is being refreshed again and again and theres an issue of the position. But dont know the solution. I have tried using a boolean

Android ListActivity onListItemClick calls adapter getView

流过昼夜 提交于 2020-01-01 06:56:18
问题 I have a very simple Activity that extends ListActivity. I am overriding the method onListItemClick do perform some custom operations. What I have seen in the logs is that the adapter methode getView is called after I click a list item (which I am overriding too in order to get my list made up by custom views). Now, I would like to know if this is the correct behavior or not. If it is I might have a problem. The problem is that my list items have images, those are fetched from web and when I

Android ListActivity onListItemClick calls adapter getView

萝らか妹 提交于 2020-01-01 06:56:10
问题 I have a very simple Activity that extends ListActivity. I am overriding the method onListItemClick do perform some custom operations. What I have seen in the logs is that the adapter methode getView is called after I click a list item (which I am overriding too in order to get my list made up by custom views). Now, I would like to know if this is the correct behavior or not. If it is I might have a problem. The problem is that my list items have images, those are fetched from web and when I

Android: failed to setContentView when switching to ListActivity

喜欢而已 提交于 2019-12-30 03:39:07
问题 [update] I got the error, which says "Your content must have a ListView whose id attribute is 'android.R.id.list'". Appearently nothing in my xml is ListView. But is that required? This is an follow-up issue on my previous question android: which view should I use for showing text and image? I read the article about creating ListView for LinearLayout. However, my following code failed at the setContentView() function when I changed "extends Activity" to "extends ListActivity", any idea why?

I have a memory leak using ListActivity in Android

情到浓时终转凉″ 提交于 2019-12-29 00:47:08
问题 I have an application that uses a Service and some list activities. When the activities are opened, I can see the heap usage increase in DDMS, when the activities are closed, the heap usage decreases slightly. The service is still running in the background at this point. If the activity is started again by re-running the application and the closed, the heap usage increases again then decreases, but never returns to the original level before the activity was first opened. If it repeatedly (10

I have a memory leak using ListActivity in Android

二次信任 提交于 2019-12-29 00:47:08
问题 I have an application that uses a Service and some list activities. When the activities are opened, I can see the heap usage increase in DDMS, when the activities are closed, the heap usage decreases slightly. The service is still running in the background at this point. If the activity is started again by re-running the application and the closed, the heap usage increases again then decreases, but never returns to the original level before the activity was first opened. If it repeatedly (10

Android: Your content must have a ListView whose id attribute is android.R.id.list

谁都会走 提交于 2019-12-28 11:51:32
问题 I'm getting this run-time error and I'm really struggling to get to the bottom of it: "Your content must have a ListView whose id attribute is android.R.id.list". Here is my code: public class ShowAllJobsInArea extends ListActivity{ Context context; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.show_jobs_in_area); context=getApplicationContext(); String area=Cookie.getAreaSelected(); final ProgressBar thinger=(ProgressBar)