我是 android 新手,我尝试在两个活动之间传输数据。Eclipse 告诉我这一行:
Intent i = new Intent(this, PostDataActivity.class);
构造函数意图未定义。我能做些什么?
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
btnShowLocation = (Button) findViewById(R.id.ansehen);
// show location button click event
btnShowLocation.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
// create class object
gps = new GpsData(StartActivity.this);
// check if GPS enabled
if(gps.canGetLocation()){
double latitude = gps.getLatitude();
double longitude = gps.getLongitude();
String mlat = String.valueOf(latitude);
// \n is for new line
Intent i = new Intent(this, PostDataActivity.class);
i.putExtra("Value1", "This value one for ActivityTwo ");