android


Send Email Via Android


I'm tring to send an email from my app and i keep getting this exception-
/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.user.trackyournevi, PID: 4220
java.lang.NullPointerException: Attempt to invoke virtual method 'android.app.ActivityThread$ApplicationThread android.app.ActivityThread.getApplicationThread()' on a null object reference
at android.app.Activity.startActivityForResult(Activity.java:4283)
at android.app.Activity.startActivityForResult(Activity.java:4230)
at android.app.Activity.startActivity(Activity.java:4567)
at android.app.Activity.startActivity(Activity.java:4535)
at com.example.user.trackyournevi.services.CommaSeparatedValues.sentAttachedMail(CommaSeparatedValues.java:88)
at com.example.user.trackyournevi.services.CommaSeparatedValues.handleActionExport(CommaSeparatedValues.java:47)
at com.example.user.trackyournevi.MainActivity.onNavigationItemSelected(MainActivity.java:125)
at android.support.design.widget.NavigationView$1.onMenuItemSelected(NavigationView.java:151)
at android.support.v7.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:811)
at android.support.v7.view.menu.SubMenuBuilder.dispatchMenuItemSelected(SubMenuBuilder.java:84)
at android.support.v7.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:152)
at android.support.v7.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:958)
at android.support.design.internal.NavigationMenuPresenter$1.onClick(NavigationMenuPresenter.java:318)
at android.view.View.performClick(View.java:5697)
at android.view.View$PerformClick.run(View.java:22526)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7224)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
My code for this intent is -
Intent email = new Intent(Intent.ACTION_SENDTO);
email.setType("plain/text");
email.putExtra(Intent.EXTRA_SUBJECT, "My Scannings");
email.putExtra(Intent.EXTRA_STREAM, Uri.parse(path));
email.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(Intent.createChooser(email , "Email:"));
I checked and non of this arguments is null..
please help me

Related Links

How to set flat/double values to layout parameters programmatically…?
android - ListActivity and ListView
android listview update list when scrolling past the top
drawable in a row for a listview changes row height
How to show a dialog by first app launching
How to Create “Page Flipping” On Android
print images using configured printer on android
Type Element type “ImageView” must be followed and Type error: Error parsing XML: not well-formed (invalid token)
When should MapActivity.isRouteDisplayed() return true?
Android - Find the orientation of photo was took by camera
Array Adapter notifyDataSetChanged() will not work
android alertdialog error
Android Back button on webview kills app
Endless ListView
how to publish image and url on facebook using latest facebook SDK for Android
get moving speed from accelormeter android

Categories

HOME
azure-stream-analytics
ggplot2
spring-data-mongodb
tivoli
rds
nested-if
interpolation
hpc
nuget-package
accessibility
pcl-crypto
enthought
atlassian
easyphp
mapstruct
lilypond
google-maps-autocomplete
babel
dpdk
visual-studio-extensions
imageresizer
displaytag
fat
pylons
jackson-modules
jasmine-node
firebase-analytics
bioinformatics
testcomplete
event-flow
instantiation
installshield-le
openwhisk
baidu-map
fiware-cygnus
roblox
numpy-broadcasting
video-capture
swagger-php
lint
ods
mongoose-schema
c9.io
ogc
dcmtk
android-ibeacon
dbnull
stylecop
rfc3339
jboss-4.2.x
ntvs
builder
tinkerpop
oozie-coordinator
type-theory
restore
stax
autosar
iotivity
mongodb-php
jquery-jscrollpane
scaffolding
jtwig
nupic
gocql
r-package
dllimport
intel-c++
graphics2d
avahi
cwrsync
ansi
nsurlsessiondatatask
rrule
rapidsvn
browserify-shim
addressing-mode
appserver
cbind
dct
vsx
amslidemenu
rfc5322
mt4j
observium
stacky
cardreader
nokia-s40
qtconcurrent
garbage
infobright
xui
collectionviewsource
cloudfiles
load-time
instantiationexception
opml
interop-domino

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App