Observer for Adaper

by » Tue, 28 Apr 2009 05:26:37 GMT

Sponsored Links
 Hi everyone!
I have an BaseAdapter and  I need to know when it stops to change data
( eg View getView(int position, View convertView, ViewGroup parent) is
no more calling ).
I tried to use registerDataSetObserver method of the Adapter:
    public class DataObserver extends DataSetObserver
        public void onChanged()
                            do smth

private DataObserver mObserver;
private BaseAdapter mAdapter;

mObserver = new DataObserver();

But it seems to be not working. Any ideas?

Observer for Adaper

by » Wed, 29 Apr 2009 05:04:26 GMT



Sponsored Links

Observer for Adaper

by Marco Nelissen » Wed, 29 Apr 2009 05:11:19 GMT

 That's not what a datasetobserver does, and I suspect that trying to figure
out when there's a pause between invocations of getView() is not going to
work quite right either.
What are you trying to achieve?

2009/4/28 <>


Other Threads

1. how to create unit tests for AppWidgetProvider

Hello all,

I am trying to do unit tests for a Widget that does not have any
activity, only RemoteViews, etc.
I tried to use android.test.AndroidTestCase but I have and issue and

1. When trying to instantiate a service via
context.getSystemService... the test fails with the error,
2. How to run tests on Methods inside a AppWidgetProvider? I guess it
is not possible to create instances of AppWidgetProvider and use the
methods inside.

Also I tried to use JUnit, but since the AppWidgetProvider depends on
a context, I was not able to get a context in pure JUnit (with
AndroidTestCase I could use getContext()).

I tried to google and look into source code in the web, but I could
not find any unit tests done for AppWidgetProviders (most were on

I would appreciate any information.



2. Creating sub sampled Bitmap Objects for images on SDcard

I am working on a small program that is supposed to :
1. Display images on the SD card
2. Get the image chosen by the User and display it on Canvas.
3. Since the image can be large, sub sample it/ scale it or something

I got the first two parts done using the following snippets:

1. By launching an intent such as:
Intent photoPickerIntent = new Intent(
startActivityForResult(photoPickerIntent, RQST_CODE);

2. The chosen image URI is received in onActivityResult(..):
Uri chosenImageUri = data.getData();

Now, I can create a Bitmap object from this URI :

The problem is: I want to resize/sub sample this bitmap. I did a bit
of reading and found a certain
BitmapFactory.Options class that has parameters whereby one can
specify the sample size. This "options" instance can be passed to one
of several overloaded BitmapFactory.decodeXX(..) methods, but none of
these methods take a URI as parameter.

Is there a way to do this?

I even tried this:
BitmapFactory.Options options = new BitmapFactory.Options();
                                options.inSampleSize = 2;

AssetFileDescriptor fileDescriptor =null;
        try {
                fileDescriptor = 
        } catch (FileNotFoundException e) {
        try {
                } catch (IOException e) {

        mBitmap = BitmapFactory.decodeFileDescriptor

But i am still getting null in mBitmap.


3. KSoap - How to pass a dataset to a dotNet webservice?

4. Implementation of a new view

5. ADC2 results

6. how?

7. hardware independent USB driver for android