How to use built in email application to send email from my application

by Satish » Thu, 11 Mar 2010 20:48:02 GMT


Sponsored Links
 Hello,

               I want is to automatically compose an e-mail with a
subject line, recipient address and an image attachment, and an e-mail
app should then pop up with this automatically composed  message, to
let the user decide whether to send, edit or discard the message.


Thanks

--



How to use built in email application to send email from my application

by Satish » Wed, 17 Mar 2010 04:27:01 GMT


 Hello,

                I want is to automatically compose an e-mail with a
subject line, recipient address and an image attachment, and an e-mail
app should then pop up with this                 automatically
composed  message, to let the user decide whether to send, edit or
discard the message.


Thanks

--


Sponsored Links


How to use built in email application to send email from my application

by Gulfam » Wed, 17 Mar 2010 14:00:58 GMT


 Hi Satish

Check this working for me:

public void launchEmailActivity(){

                final  Intent emailIntent = new
Intent(android.content.Intent.ACTION_SEND);
                emailIntent .setType("plain/text");
                emailIntent .putExtra(android.content.Intent.EXTRA_EMAIL, new
String[]{""});
                emailIntent .putExtra(android.content.Intent.EXTRA_SUBJECT, 
"Test
Subject");
                emailIntent .putExtra(android.content.Intent.EXTRA_TEXT, 
"Testing
email text");
                this.startActivity(Intent.createChooser(emailIntent, "Send
mail..."));
        }

Best Regards,
Gulfam Hassan





--



Other Threads

1. Boot Camp: Mobile Application Development

For the first time in NCR region!!

A golden opportunity to ride the next wave of Mobile Application
Development! Come learn about the rapidly growing Mobile Applet
Industry from the "industry insiders".

What?
iPhone-Android: What lies beneath?
Live interaction with industry experts
Live iPhone-Android Demo Session
Career opportunities in Mobile Application Development
Best Ideas Contest
Exciting Prizes including "1 day FREE Lab Session"

Visit us at: www.cdcgroup.in
Like us at: www.facebook.com/cdcgroup

Contact: 0120-4107197

-- 

2. android.view.WindowManager$BadTokenException

Hi

When I try to make PopupWindow at onCreate(), the BadTokenException is
thrown.
If there is some delays when make PopupWindow, the Exception does not
occur.
But It doesn't seem a good solution.
How can I make PopupWindow at onCreate() without Exception?

05-09 21:36:09.820: ERROR/AndroidRuntime(8803):
java.lang.RuntimeException: Unable to start activity
ComponentInfo{exam.pop/exam.pop.popActivity}:
android.view.WindowManager$BadTokenException: Unable to add window --
token null is not valid; is your activity running?
05-09 21:36:09.820: ERROR/AndroidRuntime(8803):     at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2663)
05-09 21:36:09.820: ERROR/AndroidRuntime(8803):     at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2679)
05-09 21:36:09.820: ERROR/AndroidRuntime(8803):     at
android.app.ActivityThread.access$2300(ActivityThread.java:125)
05-09 21:36:09.820: ERROR/AndroidRuntime(8803):     at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
05-09 21:36:09.820: ERROR/AndroidRuntime(8803):     at
android.os.Handler.dispatchMessage(Handler.java:99)
05-09 21:36:09.820: ERROR/AndroidRuntime(8803):     at
android.os.Looper.loop(Looper.java:123)
05-09 21:36:09.820: ERROR/AndroidRuntime(8803):     at
android.app.ActivityThread.main(ActivityThread.java:4627)
05-09 21:36:09.820: ERROR/AndroidRuntime(8803):     at
java.lang.reflect.Method.invokeNative(Native Method)
05-09 21:36:09.820: ERROR/AndroidRuntime(8803):     at
java.lang.reflect.Method.invoke(Method.java:521)
05-09 21:36:09.820: ERROR/AndroidRuntime(8803):     at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:868)
05-09 21:36:09.820: ERROR/AndroidRuntime(8803):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
05-09 21:36:09.820: ERROR/AndroidRuntime(8803):     at
dalvik.system.NativeStart.main(Native Method)
05-09 21:36:09.820: ERROR/AndroidRuntime(8803): Caused by:
android.view.WindowManager$BadTokenException: Unable to add window --
token null is not valid; is your activity running?
05-09 21:36:09.820: ERROR/AndroidRuntime(8803):     at
android.view.ViewRoot.setView(ViewRoot.java:505)
05-09 21:36:09.820: ERROR/AndroidRuntime(8803):     at
android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)
05-09 21:36:09.820: ERROR/AndroidRuntime(8803):     at
android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
05-09 21:36:09.820: ERROR/AndroidRuntime(8803):     at
android.view.Window$LocalWindowManager.addView(Window.java:424)
05-09 21:36:09.820: ERROR/AndroidRuntime(8803):     at
android.widget.PopupWindow.invokePopup(PopupWindow.java:828)
05-09 21:36:09.820: ERROR/AndroidRuntime(8803):     at
android.widget.PopupWindow.showAtLocation(PopupWindow.java:688)
05-09 21:36:09.820: ERROR/AndroidRuntime(8803):     at
exam.pop.popActivity.makepopup(popActivity.java:41)
05-09 21:36:09.820: ERROR/AndroidRuntime(8803):     at
exam.pop.popActivity.onCreate(popActivity.java:22)
05-09 21:36:09.820: ERROR/AndroidRuntime(8803):     at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1047)
05-09 21:36:09.820: ERROR/AndroidRuntime(8803):     at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2627)

public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        makepopup();
}

public void makepopup(){
        LayoutInflater li = LayoutInflater.from(this);
        View v1 = li.inflate(R.layout.newpop, null);
                popup = new PopupWindow(v1, 400, 240, true);
        popup.showAtLocation(v1, Gravity.CENTER, 0, 0);

        Button btClose = (Button)v1.findViewById(R.id.close);
        btClose.setOnClickListener(new View.OnClickListener() {

                        @Override
                        public void onClick(View v) {
                                // TODO Auto-generated method stub
                                if(popup != null)
                                        popup.dismiss();
                        }
                });
    }

-- 

3. emulator too slow

4. [WTB] Samsung Galaxy Tab 1 (7inch) second

5. HELP! O1 ane masuk emergency mode

6. SectionIndexer Tweak

7. How to Get 3G/UMTS Signal Strength Values: HELP PLEASE!