This blog has been moved to algo.rahulblogs.com
For this post please go to
http://algo.rahulblogs.com/2010/08/string-to-hexadecimal-conversion/
Online Diary for trouble shooting of daily technology problems.It have mixture of different flavors of technologies like android, windows problems, linux as well as the good informative links related to online movies or music or travel.
package com.example.checkforresult;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;
public class CheckStartActivityForResult extends Activity {
int requestCode;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
Log.d("CheckStartActivity","OnCreate");
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Intent i = new Intent(this,CalledActivity.class);
startActivityForResult(i, requestCode);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
Log.d("CheckStartActivity","onActivityResult and resultCode = "+resultCode);
// TODO Auto-generated method stub
super.onActivityResult(requestCode, resultCode, data);
if(resultCode==1){
Toast.makeText(this, "Pass", Toast.LENGTH_LONG).show();
}
else{
Toast.makeText(this, "Fail", Toast.LENGTH_LONG).show();
}
}
}
package com.example.checkforresult;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
public class CalledActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.d("CalledActivity","OnCreate ");
//String value = "rahul";
Intent in = new Intent();
setResult(1,in);//Here I am Setting the Requestcode 1, you can put according to your requirement
finish();
}