Search Results

Search found 2 results on 1 pages for 'henryadamsjr'.

Page 1/1 | 1 

  • Why does Android's onItemClick want a long for row Id?

    - by HenryAdamsJr
    For a listView, when you register an OnItemClickListener, the method you specify looks like this: public abstract void onItemClick (AdapterView parent, View view, int position, long id) The id corresponds to the row that the user clicked on. My question is simply why is it a long and not an int? When would you use it as a long? I've been casting it to an int when I use it, so it makes me think that maybe I'm using it wrong.

    Read the article

  • Android service puts multiple instances of an activity in the history

    - by HenryAdamsJr
    I'm making a music player. When you press play, it loads a notification into the OnGoing section. When you go anywhere else in the system, I want the music to keep playing. All of this is fine. The problem is that when I relaunch my activity from the Notification, it adds a task to the history stack each time, so if I hit back, I have to see the instance of Activity B from where I pressed play, and from every time I clicked on the notification to go back to Activity B. I want the instance of Activity B that I launch from the notification (via the service) to be the only copy of that Activity in the history. I've been playing around with various Intent flags and Activity attributes in the manifest, but I haven't found the proper combination.

    Read the article

1