I have created a class "mainapp" which extends "Application" . Also i have class which "listenerapp" extends "Thread". In the mainapp class, i am invoking this listenerapp class. In the listernerapp class, i have the following code:

synchronizedvoid stop() {
try {

catch (NullPointerException e) {
// The notify object likely failed to open, due to an IOException.

publicvoid run() {
synchronized(this) {

// Invoke.invokeApplication(Invoke.APP_TYPE_PHONE,
// new PhoneArguments(PhoneArguments.ARG_CALL,"555-5555" ));

try {
ApplicationManager manager = ApplicationManager.getApplicationManager();
ApplicationDescriptor descriptors[] = manager.getVisibleApplications();
//Retrieve the name of a running application.

for (int i = 0; i<descriptors.length;i++){
ApplicationDescriptor descriptor = descriptors[i];
if (descriptor.getName().equals("Phone" )) {
out.println("Inside Phone");
manager.requestForeground( manager.getProcessId(descriptor) );


From my mainapp, i wish to control the phone app. For example , putting phone # in the given textbox etc.....and what are the list of fields available in the screen which is visible..........

I am not able to get a handle to this application to control this. .......can anyone pls guide me on this...........this is really really urgent.....can u pls help me with a sample code......i am a beginner in blackberry libraries...