当我运行项目时,我收到错误是致命的异常:主要在logcat中 [英] When I run the project I'm getting error as fatal exception: main in logcat

查看:66
本文介绍了当我运行项目时,我收到错误是致命的异常:主要在logcat中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的Contact.java



包com.example.helloworld;

import android.app.Activity;

导入android.os.AsyncTask;

导入android.os.Bundle;

导入android.util.Log;

import android.view.View;

import android.widget.EditText;



公共类联系人扩展活动{

EditText textName;

EditText textSubject;

EditText textMessage;

public void onCreate(Bundle savedInstanceState){

super.onCreate(savedInstanceState);

setContentView(R.layout.contact);

}

public void List(View v){

super.onBackPressed();

}



public void SendMail(View v){



最终GMailSender发送者=新GMailSender(nani22791@gmail.com,xxxxx);

新AsyncTask< void,>() {

@Override public Void doInBackgrou nd(Void ... arg){

尝试{

sender.sendMail(hi,message,murugan,murugan.siva87@gmail。 COM);

} catch(异常e){

Log.e(SendMail,e.getMessage(),e);

}

返回null;

}

} .execute();



}

}

This is my Contact.java

package com.example.helloworld;
import android.app.Activity;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.EditText;

public class Contact extends Activity {
EditText textName;
EditText textSubject;
EditText textMessage;
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.contact);
}
public void List(View v){
super.onBackPressed();
}

public void SendMail(View v) {

final GMailSender sender = new GMailSender("nani22791@gmail.com", "xxxxx");
new AsyncTask<void,>() {
@Override public Void doInBackground(Void... arg) {
try {
sender.sendMail("hi","message","murugan","murugan.siva87@gmail.com");
} catch (Exception e) {
Log.e("SendMail", e.getMessage(), e);
}
return null;
}
}.execute();

}
}

推荐答案

这篇关于当我运行项目时,我收到错误是致命的异常:主要在logcat中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆