I have problem in my code in the commented lines:
bouton.setOnClickListener(new OnClickListener()
{
public void onClick(View v)
{
url=edit.getText().toString();
System.out.println(url);
// this line and
Intent Activite=new Intent(this, Main1.class);
Activite.putExtra("param", url);
/// this line
this.startActivityForResult(Activite, 1000);
}
});
Can you help me to correct my code
either remove
thisfrom the line where you are starting the next activity.OR
use:
Basically when you are saying this :
this.startActivityForResult(Activite, 1000);“this” is corresponding to the context of OnClickListener and not of the Activity you are in. As you already know thatstartActivityForResultis a method onActivityclass and not ofandroid.view.View.OnClickListenerclass.Hope this helps!!