0

I have one activity in one application, which is supposed to run another activity in another application, while passing to it an arguments|(Through putExtra)

The problem is that I know that I must add something like:

Intent i = new Intent(target);
i.setAction("actionstring" + System.currentTimeMillis());

to the target intent(activity) so the system wont override the Extra's and ill get diffrent extra's each time i run the target activity.

But when i add the setAction i get an error:

couldnt find activity: No Activity found to handle Intent { action=actionstring1278829343752 flags=0x10000000 (has extras) }

Any idea how could I solve it with setAction? maybe something I have to add also to the manifest?

rayman
  • 20,786
  • 45
  • 148
  • 246

2 Answers2

0

You can not use setAction for what you're trying to achieve, you must use [putExtra][1].

[1]: http://developer.android.com/reference/android/content/Intent.html#putExtra(java.lang.String, java.lang.String[])

Al Sutton
  • 3,904
  • 1
  • 22
  • 17
  • You didnt get me right, i am not using setAction inorder to put the argument, i use it coz of this reason: http://stackoverflow.com/questions/3140072/android-keeps-caching-my-intents-extras-how-to-declare-a-pending-intent-that-kee //----- i gotta know how i can combine between setAction and putExtra while trying to start activity in another proccess – rayman Jul 11 '10 at 07:30
0

try First Activity:

Intent intent = new Intent(getApplicationContext,SecondActivity.class);
        intent.putExtra("KEY",value);
        intent.putExtra("KEY",VALUE);
        startActivity(intent)

Second Activity:

Intent intent =getIntent();
 confirm_txt =(TextView)findViewById(R.id.txt);
 String txt_put =intent.getStringExtra("KEY");
 confirm_tId.setText(txt_put);
yuyuvvall
  • 1
  • 1