android:intent 发送接收数据

 

	//发送					
	Intent intent = new Intent();
	intent.setClass(Send.this, Recieve.class);
	// if have something to send, use Bundle
	Bundle bundle = new Bundle();
	bundle.putString("KEY_AGE", text);
	//不用Bundle
	intent.putExtras(bundle);
	intent.putExtra("age", 55);
	startActivity(intent);

  

  接收

		Bundle bundle = this.getIntent().getExtras();
		String keyage = bundle.getString("KEY_AGE");
		age = Integer.parseInt(keyage);
		age=this.getIntent().getIntExtra("age", 10);//不用Bundle

 

//调用系统的action
		Intent i = new Intent(Intent.ACTION_DIAL, Uri
				.parse("tel://13800138000"));
		startActivity(i);

 

你可能感兴趣的:(android)