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
Developer
javec
Posts: 445
Registered: ‎07-15-2008

Extract text from Browser/eMail

Hello,

on OS 5.0 and lower, this code works perfectly for copying text from the browser or from an email message etc via a menu item...

 

 

public Object run(Object context) {     
        Object text = "";
        Screen screen = Ui.getUiEngine().getActiveScreen();
        Field fieldWithFocus = screen.getLeafFieldWithFocus();
        if(fieldWithFocus.isSelectionCopyable()) {
            fieldWithFocus.selectionCopy(Clipboard.getClipboard());
            text = Clipboard.getClipboard().get();   
        }
        Dialog.alert((String)text);         
        return context;
    }

 

 

...but on OS 6.0 that code does not work in the Browser or in HTML emails, I think that is because of the WebKit browser thing. Can someone help me here how to correctly extract text via a menu item in OS 6.0?

Thanks!!

If your question was answered, please accept it as a sollution and / or give Kudos ;-)
______________________________
Use the Search Field first! Maybe the question you want to ask already exists!
Please use plain text.
Developer
javec
Posts: 445
Registered: ‎07-15-2008

Re: Extract text from Browser/eMail

anyone ;-)?

If your question was answered, please accept it as a sollution and / or give Kudos ;-)
______________________________
Use the Search Field first! Maybe the question you want to ask already exists!
Please use plain text.