I am building an android application Where on click of an Image-view the OnBackPressed Function is called.
Here is code -
ImageView imgv = (ImageView) mCustomView.findViewById(R.id.back);
imgv.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
onBackPressed();
}
});
Now The Problem is how To send an Text-View String With this OnBackPressed function.
When you want to start second activity use this code :
When you want to come back to first activity use this code :
And finally in the first activity you can get the returned value by the following method :
AN EXAMPLE :
So for using the above code for developing the example that you said :
in forst activity start second activity :
then in the on back pressed method of second activity use this code :
Again on the first activity use this code :