I want to call the sendPicture()
from another class. but it seems i can't make sendPicture()
a static type because it has startActivity()
in it. i was wondering if its possible to call it from another class if so, how?
sendPicture()
code:
public static void sendPicture()
{
File f=new File(Environment.getExternalStorageDirectory().getAbsolutePath());
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra("address", "number");
sendIntent.putExtra("sms_body", "See attached picture");
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(f));
sendIntent.setType("image/jpg");
startActivity(sendIntent);
}