call custom Activity as startActivityForResult
In Activity A,
onItemClick()
of GridView
//create a new intent...
Intent intent = new Intent();
intent.putInt("position",position);
setResult(RESULT_OK,intent);
//close this Activity...
finish();
in Caller Activity,
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent){
super.onActivityResult(requestCode, resultCode, intent);
Bundle extras = intent.getExtras();
if(extras != null)
int position = extras.getInt("position");
}