Debugging a Widget causes ANR

by Salv0 » Fri, 14 Jan 2011 21:18:38 GMT

Sponsored Links
 Hi all :)
I'm trying to debug an AppWidget but I incurred in a problem :D If not
setting the breakpoint the widget works good without ANR and the
commands Log.v are executed flawlessly. Then I placed a breakpoint on
the top of the following method:

    public void onReceive(Context context, Intent intent) {
    Log.v(TAG, "onReceive 1"); // BP on this line
    super.onReceive(context, intent);
    String action = intent.getAction();

    // Checks on action and computations ...

    Log.v(TAG, "onReceive 2");
    Log.v(TAG, "onReceive 3");

The breakpoint stops the execution as expected but then the process
dies. The problem is that the breakpoint ( I guess xD ) cause an ANR
and the ActivityManager kills the process. That's the Log:

01-07 14:32:38.886: ERROR/ActivityManager(72): ANR in
01-07 14:32:38.886: INFO/Process(72): Sending signal. PID: 475 SIG: 9
01-07 14:32:38.906: INFO/ActivityManager(72): Process
com.salvo.wifiwidget (pid   475) has died.

This cause the debug to stop. So the question is: there's a way to
debug the widget without incurring in the ANR?? thanks in advance for
the answers


Other Threads

1. HELP!! the code will not compile and I can't find anybody with the same issue

I have attached screen shots but eclipse keeps saying that

Description     Resource        Path    Location        Type
The project was not built since its build path is incomplete. Cannot
find the class file for java.lang.Object. Fix the build path then try
building this project   HelloAndroid            Unknown Java Problem
The type java.lang.Object cannot be resolved. It is indirectly
referenced from required .class files       HelloAndroid/
src/com/android/hello   line 1  Java Problem
any help please im or email me

tensec3kgt19 on msn


2. Modifying data before passing it to a list

    I have an app that reads Contacts and displays them in a list. I
want to modify some of the data before passing it to the list. Is that
possible? Here is my applications OnCreate() method

public void onCreate(Bundle savedInstanceState) {

        mCursor = getContentResolver().query(People.CONTENT_URI,
                                null, null, null, null);

        ListAdapter adapter = new SimpleCursorAdapter(
                this, // Context.
                new String[] {People.NAME, People.NUMBER},
                new int[] {,});


For instance I want to change the Phone number of each of the contacts
(e.g. prefix it with country code). Is that possible? If so, how?

I also want to add another column to the cursor. This column will have
data from another source (Eg. Contact Category, Photo etc.). Is that
possible? If so how?


3. Looking for testers - Community App Store

4. I can't use ant to build an android application?

5. Using the gravity attribute

6. How to start the native Camera app in 1.0 SDK?

7. Moto Hiring Andriod devs