BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 07-28-2009, 05:23 AM   #1 (permalink)
New Member
 
Join Date: Jul 2009
Model: 8700
PIN: N/A
Carrier: Developer
Posts: 1
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default get file attachment from message

Please Login to Remove!

Hello everybody! i am new blackberry developer and i have a problem with my application: i want to get attack file from message when user click 'send' button.

import net.rim.blackberry.api.mail.SendListener;
import net.rim.blackberry.api.mail.Folder;
import net.rim.blackberry.api.mail.Session;
import net.rim.blackberry.api.mail.Store;
import net.rim.blackberry.api.mail.Message;

public class Test extends UiApplication implements SendListener{

public Test()
{
pushScreen(new TestScreen());
}

public static void main(String args[])
{
Test theApp = new Test();
theApp.enterEventDispatcher();
}
// Inner class
private class TestScreen extends MainScreen
{
super();
setMailListener();
}
/**
* This method is the implementation of the
* method from
* interface SendListener.
*/
public boolean sendMessage(Message msg) {
// i want to get attack file from this message
Object obj = msg.getContent();
System.out.println("Message content: " + obj);
}

/**
* Adds the Sendlistener
*/
public void setMailListener() {

Session session = Session.getDefaultInstance();

Store store = session.getStore();

store.addSendListener(this);
}


/**
*
* Removes the folder listener
*/
public void removeMailListener() {

Store store = Session.getDefaultInstance().getStore();
store.removeSendListener(this);
}
}

please help me!
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

GE-Fanuc IC693CPU352-EK CPU Module
$549.99
GE-Fanuc IC693CPU352-EK CPU Module pictureSIMATIC S7-1200, CPU 1212C, AC/DC/RLY, 6ES7212-1BE40-0XB0, 6ES72121BE400XB0
$154.99
SIMATIC S7-1200, CPU 1212C, AC/DC/RLY, 6ES7212-1BE40-0XB0, 6ES72121BE400XB0 pictureAllen Bradely 1785-L40B C 5/40 Processor Module
$150.0
Allen Bradely 1785-L40B C 5/40 Processor Module pictureSIMATIC S7-1200, CPU 1211C, DC/DC/RLY, 6ES7211-1HE40-0XB0, 6ES72111HE400XB0
$114.99
SIMATIC S7-1200, CPU 1211C, DC/DC/RLY, 6ES7211-1HE40-0XB0, 6ES72111HE400XB0 pictureSIMATIC S7-1200, CPU 1211C, DC/DC/DC, 6ES7211-1AE40-0XB0, 6ES72111AE400XB0
$114.99
SIMATIC S7-1200, CPU 1211C, DC/DC/DC, 6ES7211-1AE40-0XB0, 6ES72111AE400XB0 picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.