Hi!

In my application if user want to send sms, he can open default sms / watsapp by clicking the button,

But the problem is, after sending the sms i have move to another activity of my application.


My Application

parent activity_1 --------> watsapp / sms ------> parent activity_2


what type of Intet i have to use for this..,


My Code is

Java Code:
	@Override
							public void onClick(DialogInterface dialog,
									int which) {
						
									AlertDialog.Builder builder = new AlertDialog.Builder(
											Main.this);
									builder.setTitle("Send By Using..,");
									builder.setPositiveButton("Watsapp",
											new DialogInterface.OnClickListener() {

												@Override
												public void onClick(
														DialogInterface dialog,
														int which) {
													// TODO Auto-generated method
													// stub
													String ssms = "Your Partner's " + "\n" + "ID : "
															+ prefer.getString("u_id", "") + "\n"
															+ "Password : " + prefer.getString("u_ps", "");
													boolean isWhatsappInstalled = whatsappInstalledOrNot("com.whatsapp");
													if (isWhatsappInstalled) {
														Intent sendIntent = new Intent();
														sendIntent
																.setAction(Intent.ACTION_SEND);
														sendIntent.putExtra(
																Intent.EXTRA_TEXT,
																ssms);
														sendIntent
																.setType("text/plain");
														sendIntent
																.setPackage("com.whatsapp");
														edt.putBoolean("is_old_pass", false);
														edt.commit();
														startActivity(sendIntent);
													
													} else {
														Toast.makeText(
																Main.this,
																"WhatsApp not Installed",
																Toast.LENGTH_SHORT)
																.show();
														Uri urie = Uri
																.parse("market://details?id=com.whatsapp");
														Intent goToMarket = new Intent(
																Intent.ACTION_VIEW,
																urie);
														startActivity(goToMarket);

													}

												}
											});
									builder.setNegativeButton("SMS",
											new DialogInterface.OnClickListener() {

												@Override
												public void onClick(
														DialogInterface dialog,
														int which) {
													// TODO Auto-generated method
													// stub
													Intent intent = new Intent(
															Intent.ACTION_PICK,
															ContactsContract.CommonDataKinds.Phone.CONTENT_URI);
													startActivityForResult(intent, 2);
												}
											});
									AlertDialog a_dialog = builder.create();
									a_dialog.show();






							}

After sending sms i have to call this activity

Java Code:
	Intent mapa = new Intent(Main.this, SampleLoc.class);
														mapa.putExtra("Agent_id",
														et_idm.getText().toString());
														mapa.putExtra("Randpassword",
														et_pwm.getText().toString());
														mapa.putExtra("masr_agent", "agent");
														startActivity(mapa);

Your idea is enough for me, Guide me Please..,

Thank You!

Have A Happy Day..,