listactivity

onClick inside ListActivity using SimpleCursorAdapter

Hey guys, I've got a class that creates a list from a DB using SimpleCursorAdapter. I want to add an onClick event to each item in the list but I don't know where to place the code. Any help? ...

Selectable width of list items in ListActivity

In an Android project I am working on I have a ListActivity that is set up like this: public class myClass extends ListActivity { public void onCreate(Bundle savedInstanceState) { ... String[] menuItems = new String[] { "View", "Share", "Delete" }; ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, ...

notifyDataSetChanged() does not update listActivity ?

hello, i have a problem with notifyDataSetChanged() the data source (mData) has been changed, but the list did not change itself . i need your help. thx! public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.fairlist); mData = getData(); SimpleAdapter adapter = new SimpleAd...

Android: Bind data to a ListView without preparing ArrayLists for the ListAdapter?

Right now, I get my Models in a nice object-oriented form. In order to bind them to my List, I have to use the listAdapter. Can I only fill this listAdapter with stupid ArrayLists? Because that means, I have to iterate over my ModelCollection and pull all the data out of my Models again. So, I detach my data from the models and I cant ...

Starting new activity in the Android SDK

Hey, So I have this code in my main activity to start a new one: public class MainActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); findViewById(R.id.GoButton).setOnClickListener(new View.OnClick...

SQLite to ListActivity

Hello. I have this code in my DataBase Helper: public ArrayList<ArrayList<Object>> getAllRowsAsArrays() { // create an ArrayList that will hold all of the data collected from // the database. ArrayList<ArrayList<Object>> dataArrays = new ArrayList<ArrayList<Object>>(); // this is a database call that creates a "cursor" ...

Android - findViewById(R.id.list) returns null

Hi, I have a class that is called when my app launches. public class MainActivity extends Activity implements NetworkEvent. In this situation, list = (ListView) findViewById(R.id.list); works perfectly. However if I then call a new intent via: String[] names = object.names(); Intent myIntent = new Intent(MainActivity.this, ...

Dynamic ListView extends Activity

Is there anyway I can create a dynamically filled ListView when the class does not extend ListActivity? I appreciate the help. ...

How to create a List with XML DOM Parsed Data

Hi, How to create a List with XMLParsed Data ... In XML one text tag Having 7 Attributes And I have to Display them in a List. Parsing is done By DOM. private void DownloadLINK(String URL) { TextView display = new TextView(this); InputStream in = null; try { in = OpenHttpConnection(URL); Document doc = null; DocumentBuilderF...

Ways To Show Info Related To ListActivity Items (Toast, New Page, etc)

Hi, I am working on learning Android programming. I am attempting to build an app that shows a list of items, and when the user clicks on an item, it will display an image of that item, as well as information about it. I'm not sure the best way to present this information. Would using the Toast widget be best? Or TextView? Or, is there ...

Android ActivityList - Loading data from network best practice

Hello, I have multiple ListActivity(s) with a custom ArrayAdapter. I have to load an XML file from the Web, and the user moves to a new activity by selecting a list item. What is best practice for: Displaying a loading indication to the user. Threading the networking stuff so that the user can cancel the loading of the data if need b...

New activity from default preferences

Hi. I have setup my default android Preferences with the necessary options. The prime reason of the Preferences are to allow users to manage their resources. In the context of my app, they are "Contacts", "Types of projects" and "Currency". The "Currency" section works fine. The display just yet, not the programming. But what I really ...

what difference have ListActivity between Activity???

I need to change Activity to ListActivity. But I can't start my project... do ı need change manifest.xml for it?? Or how can I change screen from Activity to ListActivity? Is there any difference to startActivity(new Intent(this, list.class)) ? 10-05 17:34:54.722: ERROR/AndroidRuntime(11550): java.lang.RuntimeException: Unable to star...

I have a memory leak using ListActivity in Android

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 ...

Android. SQLite Exception: no such column _id

Hello! Im having some troubles trying to get the info stored in my database and showing it in a ListView. This is the ListActivity where i want to show the rows: public class Prueba extends ListActivity{ /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { s...

ListActivity/ListView content is "disappearing"

I'm having a problem with my ListView in a ListActivity with a Custom ArrayAdapter. When the ListActivity becomes hidden (paused, whatever), the data that was present in the ArrayAdpater seems to go away. Rotation works fine, but I am only assigning the array in the ArrayAdapter in the onCreate(), nowhere else. The array is stored in ...

Swap between listactivity and mapactivity android programming

I am trying to create a listactivity and mapactivity.And I am trying to swap between the two. I am new to android and I was wondering if I might get any guidance. I have the content to display listActivity and the content to display mapactivity.But not swap them at the same time. Please help... ...

Context menu in list activity.

Hi. I have list activity with custom array adapter and I can't to get context menu when make long press on list item. <TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content"/> <FrameLayout android:id="@android:id/tabcontent" ...

How to save the instancestate of my activity

I obviously new and have been trying to two days to figure out how to save the state of my main activity to no avail. I would appreciate any help. When I launch the ShowDetail activity and return to the main activity I have no data in the list. I have two xml files a main.xml and a item.xml file. main is just a listview and a textview. I...

Identify the item clicked on ListActivity method onListItemClick

Hello. I'm developing an Android application. I have several objects loaded on a ListActivity. I want to know the item clicked on event onListItemClick. I see method onListItemClick has a parameter called id. How can I setup this id? My objects are identified by an ID, how can I add this ID to listItem? Thanks. ...