Hi,
I meet an problem I want select the privious item in listview when
I go to the child activity and click the cancel button.
Button editButton= (Button)
findViewById(R.id.config_intervals_edit_button);
editButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if(selectedPosition!=-1){
Intent editIntent = new
Intent(WCAConfigIntervalsView.this,WCAConfigIntervalsRowView.class);
editIntent.putExtra("isEdit", true);
editIntent.putExtra("config_interval_index",
selectedPosition);
// ?????????I think it is better to store the
previous selected
item, but I don't know how to //solve this problem
startActivityForResult(editIntent,
CONFIG_INTERVALS_EDIT_INDEX);
}
}
});
I am trying to select the previous item again but it doesnt work,
when the cancel button is clicked the onactivityresult will be
called,
@Override
protected void onActivityResult(int requestCode, int resultCode,
Intent data) {
// TODO Auto-generated method stub
super.onActivityResult(requestCode, resultCode, data);
Log.v("callback", selectedPosition+"");
//?can not use set selection
configIntervalsListView.setSelection(selectedPostion);
}
the setSelection will not select the previous item. Is any one know
this problem, or tell me how could use code to click the listview item
to flip the item click listener?
Thank you
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en