我有一个带有 android:onClick="getGraph" 的按钮,因此我在单击它时创建了一个函数,它检索位于 CheckByDate.java 的用户输入
public void getGraph (View view)
{
tv = (TextView)findViewById(R.id.textView1);
textDay = (EditText) findViewById(R.id.textDay);
textMonth = (EditText) findViewById(R.id.textMonth);
textYear = (EditText) findViewById(R.id.textYear);
day = textDay.getText();
month = textMonth.getText();
year = textYear.getText();
date = day + "/" + month + "/" + year;
Intent dategraphintent = new Intent(CheckByDate.this, DateGraph.class);
dategraphintent.putExtra("date", date);
startActivity(dategraphintent);
}
然后,在我的 DateGraph.java 中,我放了这样的东西
public Intent getIntent(Context context)
{
String date;
date = getIntent().getStringExtra("date");
.
.
.
. //This is where the date will interact with my web service, then receive
. //an array set of values, and plot as a graph
.
.
}
但是,我不知道,当我点击按钮时,它会强制关闭,我完全不知道,有什么想法吗?我试过用你的方法,还是我犯了一些愚蠢的错误??拜托我需要你的帮忙....