0
I have a problem that should be simple, I want to move to another Ctivity, a drawable as parameter.
here is my Onclick function:
img1.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v){
Intent it = new Intent(List.this, StoryActivity.class);
Drawable d = getResources().getDrawable();
it.putExtras();
startActivity(it);
}
});
For example, I have an image file called img1.jpg.
I want this function to pass to the other Activity this parameter, so that once the second Activity is triggered it knows which file to show.
I left it like this: int drawable = //R.drawable.img1 When I defined putExtras the way I said it returned an error saying: "Cannot resolve method 'putExtras(java.lang.String, int)'
– felipe218
The only modification I had to make was in "it.puExtra(...);"
– felipe218
@felipe218 , well noted, I wrote the wrong method. The correct is to use
putExtra()
and notputExtras()
– regmoraes