I have a listView with OnItemClickListener. When I click on an element, I would like to open a new wiew in a new form:
final ListView lv1 = (ListView) findViewById(R.id.ListView02); lv1.setAdapter(new SubmissionsListAdapter(this,searchResults)); lv1.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View v, int position, long id) { Intent myIntent = new Intent(v.getContext(), UserSubmissionLog.class); startActivityForResult(myIntent, 0); UserSubmissionLog userSubmissionLogs= new UserSubmissionLog(position); System.out.println("Position "+position); } } );
The problem is that I need to transfer the number of the pressed position to a new activity and do not know how to do it.
Thanks.
source share