Hi-register a BroadcastReceiver to listen to the change in network
connectivity. You'll need to register this receiver in the Manifest file
since you want it to be active even when the Application is not in the
foreground. Then in your onReceive you can do something like this:
ConnectivityManager connectivityManager = (ConnectivityManager)
context.getSystemService( Context.CONNECTIVITY_SERVICE );
NetworkInfo activeNetInfo =
connectivityManager.getActiveNetworkInfo();
if(activeNetInfo!=null){
//send your email
{
On Thursday, July 4, 2013 6:11:11 AM UTC+1, Sadhna Upadhyay wrote:
>
> Hi guys,
> i am creating a app in which i have to email and the issue is this
> that mail should be send whenever net is connected,even application has
> been exit.
> may be some gramatical here please ignore that and please help me
>
>
>
--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.