我的代碼...得到錯誤嘗試發送電子郵件
public class AndroidEmailActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final EditText edittextEmailAddress = (EditText) findViewById(R.id.email_address);
final EditText edittextEmailSubject = (EditText) findViewById(R.id.email_subject);
final EditText edittextEmailText = (EditText) findViewById(R.id.email_text);
Button buttonSendEmail_intent = (Button) findViewById(R.id.sendemail_intent);
buttonSendEmail_intent.setOnClickListener(new Button.OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
String emailAddress = edittextEmailAddress.getText().toString();
String emailSubject = edittextEmailSubject.getText().toString();
String emailText = edittextEmailText.getText().toString();
String emailAddressList[] = { emailAddress };
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("plain/text");
intent.putExtra(Intent.EXTRA_EMAIL, emailAddressList);
intent.putExtra(Intent.EXTRA_SUBJECT, emailSubject);
intent.putExtra(Intent.EXTRA_TEXT, emailText);
startActivity(Intent.createChooser(intent,
"Choice App t send email:"));
}
});
}
}
我收到錯誤在控制檯窗口
[2011-10-18 12:43:54 - AndroidEmail] Re-installation failed due to different application signatures.
[2011-10-18 12:43:54 - AndroidEmail] You must perform a full uninstall of the application. WARNING: This will remove the application data!
[2011-10-18 12:43:54 - AndroidEmail] Please execute 'adb uninstall com.android.email' in a shell.
[2011-10-18 12:43:54 - AndroidEmail] Launch canceled!
可能重複此[thread] [1]。 [1]:http://stackoverflow.com/questions/2887436/re-installation-failed-due-to-different-application-signatures – Saurabh
這只是說,你的應用程序已經安裝在手機上。只需卸載您的應用程序,然後重新安裝它。 或您手機上的其他應用程序已經使用了您使用的軟件包名稱。 –
您是否嘗試過所提供的解決方案? –