Dear All, I want to add some TextViews to the Contacts Application, specifically in the contacts_view_item.xml.
The problem I am having is getting this new contacts_view_item available from my code additions to ContactsListActivity.java in the emulator. Whenever I call findViewById() with the ID of my new TextViews, it returns null. Debugging findViewById(), I can see that the TextViews that I have defined are not in the resulting view object (I scrutinized each child). Is there some compilation/deployment step that I am missing to get my newly defined contacts_view_item.xml onto the emulator? I wrote this up in a little more detail on the android-porting list (see appended), but this list seems to have more activity than that one. Any advice would be much appreciated. Thanks in advance, Shaun. Previously posted on android-porting: //Dear All, // //I am trying to customize the Contacts Application, specifically be //adding TextViews to the contacts_view_item.xml // //From a compilation point of view, everything seems to go well: after //running mmm packages/apps/Contacts, and subsequently grepping for the //particular TextView ID, I can see it in the following locations: // //target/common/obj/APPS/Contacts_intermediaries/src/com/android/ //contacts/R.java //target/common/obj/APPS/Contacts_intermediaries/src/R.stamp //target/common/obj/APPS/Contacts_intermediaries/public_resources.xml //target/common/R/com/android/contacts/R.java // //I then tried with my adjusted ContactsListActivity.java source to try to set some //text in my new TextViews. // //But..., whenever I call view.findViewById(), it always returns null //for the IDs of my new TextViews. // //Note: I am using the emulator, not a real device // //Can anyone shed any light on this? // //I am calling findViewById() in the same locations where it is called //by the Android-written code with similar TextViews in the same View, //so am invoking the method on the correct view. // //Some other things that I have tried: // //If I adjust my code to set my variables using the IDs for default //Android TextViews (e.g. R.id.name), I retrieve an object, and can set //the text. // //If I rename the ID for one of the default Android TextViews in //contacts_view_item.xml (e.g. change R.id.name to R.id.myname), adjust //the code accordingly, and remake everything as above, I run into my //old problem again: i.e. findViewById() returns null. // //I wondered if such changes might require me to run mmm frameworks/ base/ //core/res, in order to regenerate the framework-res.apk, but when I do //so, it reports 'Nothing to be Done'. (Since then, I have forced the recompilation of this apk, with no result: it to contain 'standard' widgets, etc., not application specific ones.) (Complete rebuilds of the 'out' directory do not rectify things). // //Many thanks in advance for any help you can shed on my problem, Shaun. -- 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

