Android 默认电子邮件应用程序不支持';不要有目的地工作。为什么&引用;ActivityNotFound异常
所以我从NewBoston教程中编写了这个程序,它应该发送电子邮件。然而,当我点击按钮时,它表示没有找到执行此操作的应用程序,但我在play store上找到了该应用程序的副本,当我按下该应用程序上的按钮时,它让我在“电子邮件”和“gmail”之间进行选择不幸的是,我看不到该副本应用程序的源代码,但他们一定在做我没有做的事情。我在三星galaxy s3 mini上运行它,但是如果我的应用程序不工作,而另一个应用程序工作,我不认为手机会出问题。必须是代码。有人能帮忙吗。请具体说明为什么我的不行而你的不行。谢谢你Android 默认电子邮件应用程序不支持';不要有目的地工作。为什么&引用;ActivityNotFound异常,android,email,android-intent,android-activity,Android,Email,Android Intent,Android Activity,所以我从NewBoston教程中编写了这个程序,它应该发送电子邮件。然而,当我点击按钮时,它表示没有找到执行此操作的应用程序,但我在play store上找到了该应用程序的副本,当我按下该应用程序上的按钮时,它让我在“电子邮件”和“gmail”之间进行选择不幸的是,我看不到该副本应用程序的源代码,但他们一定在做我没有做的事情。我在三星galaxy s3 mini上运行它,但是如果我的应用程序不工作,而另一个应用程序工作,我不认为手机会出问题。必须是代码。有人能帮忙吗。请具体说明为什么我的不行而你
package com.example.music;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AnalogClock;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class Email extends Activity implements OnClickListener {
EditText addressET, introET, nameET, stupidThingsET, toDoET, outroET;
TextView tv1, tv2, tv3, tv4, tv5, tv6;
Button button;
AnalogClock clock;
String address, intro, name, stupidThings, toDo, outro;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_email);
initialiseVars();
}
//********ON CLICK LISTENER
@Override
public void onClick(View arg0) {
convertToString();
String[] addresses = { address };
String message = "Well hello there "
+ name + " I just wanted to say "
+ intro + " and i hate it when you "
+ stupidThings + " and i just want to "
+ toDo + " and by the way "
+ outro + " You are thee best programmer in the word fuckn
genius";
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
//Since class/app is not specified will give user a choice of application that can
recieve
ACTION_SEND BITCH.
emailIntent.setType("text/plain");
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, addresses); //
Second parameter has to be an array
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "I hate you");
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, message);
startActivity(Intent.createChooser(emailIntent,
"Send Email Using: "));
}
//*********END ON CLICK LISTENER
//****CONVERT VARS TO STRING
public void convertToString(){
address = addressET.getText().toString();
intro = introET.getText().toString();
name = nameET.getText().toString();
stupidThings = stupidThingsET.getText().toString();
toDo = toDoET.getText().toString();
outro = outroET.getText().toString();
}
//*******END OF CONVERTING VARS TO STRING
//*******INITIALISING VARIABLES
public void initialiseVars(){
addressET = (EditText) findViewById(R.id.editText1);
introET = (EditText) findViewById(R.id.editText2);
nameET = (EditText) findViewById(R.id.editText3);
stupidThingsET = (EditText) findViewById(R.id.editText4);
toDoET = (EditText) findViewById(R.id.editText5);
outroET = (EditText) findViewById(R.id.editText6);
button = (Button) findViewById(R.id.button1);
button.setOnClickListener(this);
}
//******END INITIALISE VARIABLES
}
可能是您的应用程序找不到可使用的服务。确保你安装了类似gmail或任何其他电子邮件类型的应用程序,以便你的应用程序可以使用它。我刚才是否在你的代码中阅读了
ACTION\u SEND BITCH.
,我想你确实做了代码>仅用于提示电子邮件客户端。