I want to launch another application and put extras. I try did this :
private void open() {
openApplication(getActivity(), "com.app.package.here");
}
public void openApplication(Context context, String packageN) {
Intent i = context.getPackageManager().getLaunchIntentForPackage(packageN);
if (i != null) {
i.addCategory(Intent.CATEGORY_LAUNCHER);
i.putExtra(PGO_GET, pgo != null ? pgo : pgogb);
context.startActivity(i);
} else {
try {
context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + packageN)));
} catch (android.content.ActivityNotFoundException anfe) {
context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://play.google.com/store/apps/details?id=" + packageN)));
}
}
}
But it is not working.
In secend activity in loginActivity I have this :
Object ob = getIntent().getExtras().getSerializable(PGOOptionsDialog.PGO_GET);
if (ob != null) {
if (ob instanceof PGOGet) {
currentPGO = (PGOGet) ob;
} else if (ob instanceof PGO) {
pgodb = (PGO) ob;
}
}