I am having a couple of issues with code within a utility class.

1. Eclipse complains when I put a StartActivity in a utility class,
this will be called by two different activities in the app.

import android.content.Intent;
public class Util  {

         public static void sendEmail(String subjectText, String bodyText) {
                 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,
subjectText);
                 emailIntent .putExtra(android.content.Intent.EXTRA_TEXT, 
bodyText);
                 startActivity(Intent.createChooser(emailIntent, "Send 
mail..."));
         }

}

Eclipse complains about StartActivity.

2. Eclipse also complains when I do the following in a utility class.

locationManager = (LocationManager)
getSystemService(LOCATION_SERVICE);

What am I doing wrong?
Thanks

-- 
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

Reply via email to