I have two activities. The first simply displays a textView, and editText and a Button. What I want to do is, when a user click the button, I'd to start the second activity, passing the text typed in the EditText box.
What I've done is the following:
this is the first activity
Using java Syntax Highlighting
- protected void onCreate(Bundle icicle) {
- // TODO Auto-generated method stub
- super.onCreate(icicle);
- this.setContentView(R.layout.selection);
- Button btn = (Button)this.findViewById(R.id.selectionOk);
- btn.setOnClickListener(new OnClickListener(){
- public void onClick(View arg0) {
- // TODO Auto-generated method stub
- Intent myIntent = new Intent();
- myIntent.setAction("com.google.android.tvsportfinder.DO_SEARCH");
- startActivity(myIntent);
- }
- });
- }
Parsed in 0.031 seconds, using GeSHi 1.0.8.4
Before startActivity, I need to pass the data, but
Using java Syntax Highlighting
- myIntent.setData()
Parsed in 0.030 seconds, using GeSHi 1.0.8.4
Secondly, the handler of the Intent is my other activity. In the AndroidManifest.xml I've wrote:
Using xml Syntax Highlighting
- <activity android:name="SecondActivity">
- <intent-filter>
- <action android:name="com.google.android.myapp.DO_SEARCH"/>
- </intent-filter>
- </activity>
Parsed in 0.001 seconds, using GeSHi 1.0.8.4
but when I click the button on the first activity, I got that there's no activity that can handle this action. So, how to make my second activity able to receive such Intent?
Thank you



