我需要像发送字符串“title”一样发送一个imageview,但我不能,我怎样才能将一个imageview(R.drawable.image)从mainactivity发送到secondactivity?
谢谢
主要活动
public void NewActivity(View view){
Intent intent = new Intent(this, SecondActivity.class);
intent.putExtra("title", getString(R.string.title));
startActivity(intent);
}
第二项活动
@Override
public void onCreate(Bundle bundle)
{
super.onCreate(bundle);
setContentView(R.layout.pantalla);
Bundle extras = getIntent().getExtras();
if (extras == null)
{
return;
}
String title = extras.getString("title");
TextView textview = (TextView)findViewById(R.id.titulo);
textview.setText(title);
}