Я не буду посылать по электронной почте на разъединять, содержащую регистрационный номер моего кодотправить по электронной почте в GCM onRegistered
@Override
protected void onRegistered(Context arg0, String arg1) {
Log.i("Registration", "Just registered!");
Log.i("Registration", arg0.toString() + arg1.toString());
final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("plain/text");
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{ "[email protected]"});
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "test");
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, GCMRegistrar.getRegistrationId(this));
// emailIntent.putExtra(android.content.Intent.EXTRA_BCC, CC.getText());
startActivity(Intent.createChooser(emailIntent, "Send mail..."));
}
После запуска кода я получаю эту ошибку:
FATAL EXCEPTION:
IntentService[GCMIntentService-DynamicSenderIds-2]
android.util.AndroidRuntimeException:
Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag.
Is this really what you want?
спасибо, что это сработало – user3027345