Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
Posts: 14
Registered: ‎08-22-2011
My Device: BlackBerry 9800
My Carrier: Vodafone

modulesDeleted(String[] moduleNames) method is not invoking even though CodeModuleListener is added

Hi,

 

I need to call my code during uninstallation of my blackberry application.For this I added CodeModuleListener to my application.The listener is successfully added.But the problem is when i am removing(uninstalling) my application from simulator the one of the overrided method modulesDeleted(String[] moduleNames) is not invoking.

 

Please anyone help me on it. Below is my code:

 

 

private class CodeModListener implements CodeModuleListener {


public void modulesDeleted(String[] moduleNames) {
net.rim.device.api.ui.component.Status.show("Deleted......");

}

public void modulesAdded(int[] handles) {
net.rim.device.api.ui.component.Status.show("Added......");

}

public void moduleDeletionsPending(String[] moduleNames) {
// TODO Auto-generated method stub

}
}

 

 

 

in main method i added listener :

 

public static void main(String[] args) throws IOException {

BlackBerryApp theApp = new BlackBerryApp();

CodeModListener cListener = theApp.new CodeModListener();
CodeModuleManager.addListener(theApp, cListener);

theApp.enterEventDispatcher();

}

Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: modulesDeleted(String[] moduleNames) method is not invoking even though CodeModuleListener is added

Hi and welcome to the forums!

 

Are you trying to listen for when your own application is deleted? If so, this functionality is not supported, you can only listen for other modules being deleted.

 

Regards,

Garett
@garettBeuk
--
Goodbye everybody!
Contributor
Posts: 14
Registered: ‎08-22-2011
My Device: BlackBerry 9800
My Carrier: Vodafone

Re: modulesDeleted(String[] moduleNames) method is not invoking even though CodeModuleListener is added

Thank you for your response.

 

Then how I can delete my application generated files during its installation or uninstallation?

Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: modulesDeleted(String[] moduleNames) method is not invoking even though CodeModuleListener is added

If your files are created within the Persistent Store of the device then they will be deleted automatically with your application. Any files on the file system (device or SD Card) would need to be manually deleted by the user.

Garett
@garettBeuk
--
Goodbye everybody!