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");
    updateWidget(context);
    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
com.salvo.wifiwidget
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.java       HelloAndroid/
src/com/android/hello   line 1  Java Problem
any help please im or email me

[EMAIL PROTECTED]
tensec3kgt19 on msn


http://i34.tinypic.com/v5ijxx.jpg

--~--~---------~--~----~------------~-------~--~----~

2. Modifying data before passing it to a list

Hi,
    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) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

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

        ListAdapter adapter = new SimpleCursorAdapter(
                this, // Context.
                R.layout.localizer_row,
                mCursor,
                new String[] {People.NAME, People.NUMBER},
                new int[] {R.id.text1, R.id.text2});

        setListAdapter(adapter);
    }

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