SubActivites with return value - The InputBox

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

Postby Profete162 » Fri Nov 27, 2009 8:38 pm

When i try your code, i get this strange proble:

Code: Select all
Description   Resource   Path   Location   Type
The method startSubActivity(Intent, int) is undefined for the type new View.OnClickListener(){}   BETrains.java   /BETrains 1.6/src/tof/cv/mpp   line 298   Java Problem
Profete162
Experienced Developer
Experienced Developer
 
Posts: 67
Joined: Fri Nov 27, 2009 6:07 pm

Top

Postby Profete162 » Fri Nov 27, 2009 8:46 pm

I think i get the answer by myself.

I should have use startActivityForResult...

Is it right?
Profete162
Experienced Developer
Experienced Developer
 
Posts: 67
Joined: Fri Nov 27, 2009 6:07 pm

Postby bigrockshow » Tue Mar 16, 2010 3:14 am

Yes, that's right; the tutorial needs to be updated.
bigrockshow
Once Poster
Once Poster
 
Posts: 1
Joined: Tue Mar 16, 2010 3:12 am

Postby sigmacenter » Mon Apr 05, 2010 1:26 pm

why do i keep encountering this error

1. The method startSubActivity(Intent, int) is undefined for the type new View.OnClickListener(){} at this line

// We use SUB_ACTIVITY_REQUEST_CODE as an 'identifier'
startSubActivity(i, SUB_ACTIVITY_REQUEST_CODE);



2. The method onActivityResult(int, int, Intent) in the type Activity is not applicable for the arguments (int, int, String, Bundle) at this line

//@Override
protected void onActivityResult(int requestCode, int resultCode,String data, Bundle extras) {
super.onActivityResult(requestCode, resultCode, data, extras);



3. The method showAlert(String, String, String, boolean) is undefined for the type MainActivity at this line

// And show its result
showAlert("SubActivity returned", "ReturnValue: " + data,
"OK", false);


please help me, any reply will be highly appreciated. Im still a total noob at android and beginner in JAVA
sigmacenter
Once Poster
Once Poster
 
Posts: 1
Joined: Mon Apr 05, 2010 1:10 pm

Postby Profete162 » Tue Apr 06, 2010 8:30 pm

Have you read something in the topic. I guess no...

Read the 3 posts on the top of yours... You will get an answer to your first question!
Profete162
Experienced Developer
Experienced Developer
 
Posts: 67
Joined: Fri Nov 27, 2009 6:07 pm

Re: SubActivites with return value - The InputBox

Postby solider » Sat Jul 31, 2010 11:37 am

Hi all!
I try to built an app have some function:

[list=]
[*]From main Activity I try to download some .APK file on server ---> save to sdcard. I'm going to use default Browser to download[/*]
[*]When download progress finished, I want to call an Activity to setup this file, may be automatically or by "hand"[/*]
[*]When setup complete, i want return my main Activity automatically[/*]
[/list]

If you have same example, please give me via: khaintt@gmail.com, or post on this discussion.

Thanks in advandce!
solider
Freshman
Freshman
 
Posts: 4
Joined: Fri Jul 16, 2010 8:04 am

Top
Previous

Return to Novice Tutorials

Who is online

Users browsing this forum: No registered users and 3 guests