The previous one mentioned that it must be placed under the activity.
First, when a class under the activity is calledCodeAs follows:
Public void oncreate (bundle savedinstancestate) {super. oncreate (savedinstancestate); setcontentview (R. layout. main); addcontactsold (); // you must remember the class that cannot be added to the new activity, haha .............................}
The code to be added to the called class is as follows:
Public class contacttest extends androidtestcase {context; Public contacttest (context CT) {// todo auto-generated method stubthis. context = CT;} public context getcontext () {// todo auto-generated method stubreturn context ;}}
The code added in the activity is
Public void oncreate (bundle savedinstancestate) {super. oncreate (savedinstancestate); setcontentview (R. layout. main); contacttest = new contacttest (this); contacttest. testinsert ();...........................}
It is expected that Java will always appear in the use of online code. lang. nullp ....... the wrong person may have some help. I may not have strong Java knowledge. I spent two whole days in the afternoon.