Generally it is a better idea to use views as your tabs instead of
activities...

On Thu, Feb 24, 2011 at 4:14 PM, Dan <[email protected]> wrote:

> Update, the ListView in question is in activity A which is inside tab
> activity C. Tab activity C inherits from tab activity B. Removing the
> inheritance of tab activity C from B fixed the problem. C was calling
> TabActivity.getTabHost().clearAllTabs() to replace the parents tabs in
> onCreate(). Also, moving the tab construction to a separate method did
> not fix the problem. So it looks like I will have to keep to a single
> level of inheritance for activities. :(
>
> -Dan
>
> On Feb 24, 10:25 am, Dan <[email protected]> wrote:
> > I don't know how soon I'll be able to do that but something that is a
> > few steps easier is for Google and AOSP to release a tag of the Java
> > code used in the simulators.
> >
> > On Feb 23, 8:59 pm, fernando <[email protected]> wrote:
> >
> >
> >
> >
> >
> >
> >
> > > i can't see what could be wrong, except if the notifyDataSetChanged is
> > > overridden in your adapter, then somewhere in your adapter you need to
> > > call super.notifyDataSetChanged.
> > > If that's not true that would be really useful to step into the
> > > frameworks code to undestand what's wrong.  You'll need a linux
> > > machine/box or mac, get the android open source code setup the
> > > building environment, compile the sdk, run the compiled emulator and
> > > debug on it.  For the debugging environment, use Eclipse and ADT,
> > > create a plain Java project, link the frameworks/base/core/java
> > > directory after you get the open source code (contains the listview
> > > source code). (You'll be installing your apk into the compiled
> > > emulator ). Then, link this project to your application's project and
> > > debug your application.   Then press F5 to step into the list :-)
> >
> > >http://android.git.kernel.org/  -> on the top of the page, shows how
> > > to get the git repositoryhttp://
> source.android.com/source/download.html   ->instructions to
> > > setup the environment and compile the sdkhttp://
> source.android.com/source/git-repo.html   -> git basic
> > > instructions.
> > > you can use the "sun virtual box"  to host linux if you have a windows
> > > computer
> >
> > > Besides the time spent to download the tools (linux, python, java,
> > > etc, virtual box, etc) the open source code and compilation (which you
> > > can let it doing), it should take less than 2 hours of work to do all
> > > of it.
> >
> > > I hope you can find what's going on as quick as possible.  Then tell
> > > us what happened (I'm curious)
> >
> > > thanks
> > > - Fernando
> >
> > > On Feb 23, 6:20 pm, Dan <[email protected]> wrote:
> >
> > > > I have been working on a similar issue to this.  The application is
> > > > uses a ListActivity from a Library Project. This Library Project can
> > > > also be configured to be its own application (refactoring is in
> > > > progress).  The ListActivity works well when its project is used as
> an
> > > > application. However the ListView is always empty when it is used
> from
> > > > a library project.  The only difference is the data to be displayed.
> > > > I have tried different Adapters, with Maps and Cursors and using
> > > > setAdapter(), none of these have worked.
> >
> > > > I am working on API level 7. My attempts at a test application has
> not
> > > > resulted in a replication of this bug. I am banging my head against
> > > > the wall here. It would help to be able to debug into the framework
> to
> > > > see what I am doing wrong.
> >
> > > > -Dan
> >
> > > > On Jan 25, 10:33 pm, Brill Pappin <[email protected]> wrote:
> >
> > > > > I should mention this is on a Nexus One with aOS 2.2.2 in case that
> > > > > matters.
> >
> > > > > Yes, I looked all over that code and even down into AsbListView.
> > > > > It actually registers an internal instance member with the adapter,
> > > > > and the notify call does seem to make it to the observer as far as
> I
> > > > > can see, but there doesn't seem to be any code that connected the
> > > > > observer and the ListView.
> >
> > > > > I was digging down that far in the first place because I was sure
> > > > > (three times over, I rewrote it from scratch three times using
> > > > > different examples and tutorials besides my first attempt from
> memory)
> > > > > that I had correctly implemented the Adapter and set it on the
> > > > > ListView. The list view simply never called the adapter after the
> > > > > notify method was called. I know that because I used the basic
> print-
> > > > > to-log when called technique of tracing the calls. The Adapter
> would
> > > > > get properly called when first set on the ListView but after that
> no
> > > > > amount of data change and notify calls would cause it to re-read
> the
> > > > > adapter, which is what I expect it to do if I notify it that my
> data
> > > > > has changed.
> >
> > > > > I the end I simply created a new adapter and reset it on the
> ListView,
> > > > > which seems to be working, however that's broken IMO.
> >
> > > > > I think the next step should be that I write up a quick demo app
> that
> > > > > attempts replicate the problem. If it doesn't do anything except
> > > > > demonstrate what I'm seeing, then it should allow others to test as
> > > > > well.
> > > > > I'll see if I can make time tomorrow for that.
> >
> > > > > BTW - That link seems to not be visible to me :) must be on your
> > > > > internal network.
> >
> > > > > - Brill Pappin
> >
> > > > > On Jan 26, 12:35 am, Dianne Hackborn <[email protected]> wrote:
> >
> > > > > > AsbListView and ListView call registerDataSetObserver() on the
> adapter.
> > > > > >  BaseAdapter.notifyDataSetChanged() does the notification to
> whoever is
> > > > > > registered with it.
> >
> > > > > > Here is working code, the Running Services UI in settings, that
> implements a
> > > > > > BaseAdapter and uses notifyDataSetChanged() to tell the list view
> when its
> > > > > > contents change:
> >
> > > > > >
> http://android.git.kernel.org/?p=platform/packages/apps/Settings.git;...
> >
> > > > > > On Tue, Jan 25, 2011 at 8:37 PM, Brill Pappin <[email protected]>
> wrote:
> > > > > > > I just searched the forums, and apparently this is a common
> problem.
> >
> > > > > > > ListView with a custom adapter based on BaseAdapter.
> > > > > > > Its backed by a List object.
> >
> > > > > > > The problem is that updating the data and calling
> notifyDataSetChanged();
> > > > > > > does nothing.
> > > > > > > I have modified the adapter so that ever method that is called
> in it prints
> > > > > > > itself to the console.
> >
> > > > > > > my adapter has a method that does the update of the contents
> and attempts
> > > > > > > to notify:
> >
> > > > > > > public void updateData(List<Event> data) {
> >
> > > > > > >  this.data.clear();
> >
> > > > > > >  this.data.addAll(data);
> >
> > > > > > >  notifyDataSetChanged();
> >
> > > > > > > }
> >
> > > > > > > The problem is that after notifyDataSetChanged() is called, the
> list never
> > > > > > > calls any other methods, not even getCount().
> >
> > > > > > > My data has changed, and i've notified ListView that it has,
> yet it still
> > > > > > > refuses to update.
> >
> > > > > > > After some investigation in the OS source, I don't see where
> the observer
> > > > > > > in the list actually tells the list to update.
> >
> > > > > > > It seems the only way to get the list to update its elements is
> to re-set
> > > > > > > the adapter on it with the new element set.
> >
> > > > > > > Now I've seen many threads in the group saying that they user
> was doing
> > > > > > > something wrong... but I don't see how the notify is going to
> update the
> > > > > > > list period (change or no change).
> >
> > > > > > > So, I think i'm dealing with a bug here.
> >
> > > > > > > Can someone actually find the code that does the update in the
> ListVIew
> > > > > > > when adapters notifyDataSetChanged() is called?
> >
> > > > > > > - Brill Pappin
> >
> > > > > > > --
> > > > > > > You received this message because you are subscribed to the
> Google
> > > > > > > Groups "Android Developers" group.
> > > > > > > To post to this group, send email to
> [email protected]
> > > > > > > To unsubscribe from this group, send email to
> > > > > > > [email protected]<android-developers%2Bunsubs
> [email protected]>
> > > > > > > For more options, visit this group at
> > > > > > >http://groups.google.com/group/android-developers?hl=en
> >
> > > > > > --
> > > > > > Dianne Hackborn
> > > > > > Android framework engineer
> > > > > > [email protected]
> >
> > > > > > Note: please don't send private questions to me, as I don't have
> time to
> > > > > > provide private support, and so won't reply to such e-mails.  All
> such
> > > > > > questions should be posted on public forums, where I and others
> can see and
> > > > > > answer them.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to