Class problem

Put your problem here if it does not fit any of the other categories.

Class problem

Postby Mad89 » Thu Mar 05, 2009 8:46 pm

Hi! I am new, and i have some problem.

main.java
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. public class testing extends Activity {
  3.  
  4.  
  5.  
  6. invertory ivt= new invertory();
  7.  
  8.  
  9.  
  10.  @Override
  11.  
  12.             public void onCreate(Bundle savedInstanceState) {
  13.  
  14.                 super.onCreate(savedInstanceState);
  15.  
  16.  
  17.  
  18.  setContentView(R.layout.main);
  19.  
  20.  
  21.  
  22. ivt.test();
  23.  
  24.  
  25.  
  26.   }
  27.  
  28. }
  29.  
  30.  
Parsed in 0.032 seconds, using GeSHi 1.0.8.4


invertory.java
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2.  
  3.  
  4. public class invertory extends Activity{
  5.  
  6.  
  7.  
  8.         public void test() {
  9.  
  10.                
  11.  
  12.         finish();              
  13.  
  14.        
  15.  
  16.         }
  17.  
  18.  
  19.  
  20.  
  21.  
  22. }
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


Thats the matter. Its not working, not close the application.
How can I use the test method from outer class?

Thanks for your help.
Mad89
Freshman
Freshman
 
Posts: 2
Joined: Sat Jan 10, 2009 11:17 am

Top

Postby MrSnowflake » Thu Mar 05, 2009 9:50 pm

This is standard oop practice, if you call finish(), it has to be on the object you want to finish...
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Postby Mad89 » Fri Mar 06, 2009 3:59 pm

MrSnowflake wrote:This is standard oop practice, if you call finish(), it has to be on the object you want to finish...

Yes, I know its very basic, but can you give me a code snippet?
I would like to finish the running of testing class. How can i do that? Sorry for this stupid question, i just now learning.

Somebody?
Mad89
Freshman
Freshman
 
Posts: 2
Joined: Sat Jan 10, 2009 11:17 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google Feedfetcher and 14 guests