2014-04-25 4 views
1

Je veux ouvrir ContentHandler pour montrer l'image en pleine screen.So i utilisé le code suivant pour afficher une image sélectionnée en plein écranPourquoi l'application Blackberry Java redémarre-t-elle?

Invocation invocation = new Invocation(imageFilePath); 
invocation.setAction(ContentHandler.ACTION_OPEN); 
Registry _registry = Registry .getRegistry(mypackagename.myuiapplication); 
_registry.invoke(invocation); 

Le code ci-dessus parfaitement Woks. Mais quand j'ai vu une image en plein écran et quitter l'application. Mais ma demande se rouvre. Pourquoi mon application affiche-t-elle un tel comportement?

+0

vérifier journal. peut être son en raison de problème de mémoire – Signare

+0

Rien ne montre sur le journal –

Répondre

1

J'espère avoir obtenu la solution. L'application attend la réponse Invocation.Voici la solution

Invocation invocation = new Invocation(imageFilePath); 
invocation.setAction(ContentHandler.ACTION_OPEN); 
Registry _registry = Registry .getRegistry(mypackagename.myuiapplication); 
_registry.setListener(responseListener); 
registry.cancelGetResponse(); 
_registry.invoke(invocation); 


private ResponseListener responseListener = new ResponseListener() { 

    public void invocationResponseNotify(Registry registry) { 
     registry.getResponse(false); 
    } 
};