【发布时间】:2013-09-07 10:28:49
【问题描述】:
Eclipse 中的类型未定义方法。好像解决不了错误在以下行中: msg.setTimestamp( System.currentTimeMillis() ); and msg.setBody("这是一条测试短信");
package com.example.smsnotification;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
public class PopSMSActivity extends Activity{
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//Retrieve serializable sms message object by the key "msg" used to pass to it
Intent in = this.getIntent();
PopMessage msg = (PopMessage) in.getSerializableExtra("msg");
//Case where we launch the app to test the UI EG: No incoming SMS
if(msg==null){
msg = new PopMessage();
con.setPhone("0123456789");
msg.setTimestamp( System.currentTimeMillis() );
msg.setBody("this is a test SMS message");
}
showDialog(msg);
}
【问题讨论】:
-
请发布您的堆栈跟踪
-
@ankit 没有堆栈跟踪,它不会告诉你任何事情。在发布此类 cmets 之前,请仔细阅读。谢谢。
标签: java eclipse methods undefined