hi
  I write a simple activity using ADT in Eclipse, but it failed in the
emulator. the emulator show a warning message as below:

  Sorry!
  The application hello(process bluefish.hello)has stopped
unexpectedly.Please try again.

my only source file as below.

package bluefish.hello;

import android.app.Activity;
import android.os.Bundle;
import android.provider.Contacts.People;
import android.content.*;
import android.net.Uri;
import android.database.Cursor;

public class Hello extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        ContentResolver cr = getContentResolver();
        Uri uri = People.CONTENT_URI;
        Cursor cur = cr.query(uri, null, null, null, null);
        cur.close();
    }
}

But,when I modified the code as below, the activity work well.

package bluefish.hello;

import android.app.Activity;
import android.os.Bundle;

public class Hello extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
}

What's wrong ?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Android Discuss" 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-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to