android - The method putStringExtra(String, String) is undefined for the type Intent -
i trying prepare issue not understand. error "the method putstringextra(string, string) undefined type intent" in line 4 within onitemclick method. reason this?
public void onitemclick(adapterview<?> adapter, view arg1, int position, long arg3) { string item=adapter.getitematposition(position).tostring(); toast.maketext(activity.this, "you click on:"+item, toast.length_short).show(); intent intent = new intent(this, myotheractivity.class); intent.putstringextra(myotheractivity.text_to_display, item); startactivity(intent); }
just utilize intent.putextra()
. there no method putstringextra()
on intent
. knows type of parameter , adds type.
android android-intent
No comments:
Post a Comment