以下代码适用于设置为最新 (4..) android 版本的模拟器,但不适用于运行 android 2.3 的真实 Galaxy。我怎样才能让我的应用程序也能在旧版本上运行?
Intent callingIntent = getIntent();
//check if it was an Edit/GetContent action
if (callingIntent.getAction() == Intent.ACTION_EDIT){
EditText editSubject = (EditText) findViewById(R.id.editText1);
EditText editBody = (EditText) findViewById(R.id.editText2);
//get data:
String body = callingIntent.getStringExtra("body");
String subject = callingIntent.getStringExtra("subject");
//show data:
editSubject.setText(subject);
editBody.setText(body);
}