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
New Developer
Posts: 50
Registered: ‎03-18-2009
My Device: 8530
Accepted Solution

How I can do for Convert String Text to Object for put into the Clipboard.

[ Edited ]
Hi All, I am newbie and I have a problem with Clipboard method. I want to put a String Text into the clipboard but the method Clipboard.put require an object. What I can do for convert my String text to Object?

 

My code below:

 

 

String message = OriginalMessage.getBodyText();

String[] selections = {"Copy","Cancel"};
Dialog addDialog = new Dialog("Copy to Clipboard", selections, null, 0, null);
LabelField field = new LabelField(message);
addDialog.add(field);

if(addDialog.doModal() == 0) // User selected "Copy".
{

Clipboard cb = new Clipboard.put(message);

}

 

 Please Help me.

 

 

 

Message Edited by javiergv on 04-25-2009 12:17 PM
// Code for getting Thanks
if( iWasHelpful && solvedYourProblem ) {
Thanks++;
solution = true;
}
Developer
Posts: 120
Registered: ‎07-16-2008
My Device: 9000

Re: How I can do for Convert String Text to Object for put into the Clipboard.

A String is an Object in Java.  You can just call Clipboard.getClipBoard().put(message);
Kurt Zettel | Chief Architect | Metova
www.metova.com
New Developer
Posts: 50
Registered: ‎03-18-2009
My Device: 8530

Re: How I can do for Convert String Text to Object for put into the Clipboard.

Thanks a lot it´s working now.
// Code for getting Thanks
if( iWasHelpful && solvedYourProblem ) {
Thanks++;
solution = true;
}