Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - Newb--Q: How to get VARIABLE from ACTIVITY

Newb--Q: How to get VARIABLE from ACTIVITY

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

Newb--Q: How to get VARIABLE from ACTIVITY

Postby doubleslash » Sun Mar 01, 2009 7:05 am

Hi,
Can you tell me how to access a private variable (count in the following example) defined in Activity?
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public class Myapp extends Activity{
  2.  
  3. private int count;
  4.  
  5. public int get(){
  6.  
  7. return count;
  8.  
  9. }
  10.  
  11. }
Parsed in 0.012 seconds, using GeSHi 1.0.8.4
In another file, I tried to access count as follows, but it failed.
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public class MyView extends View{
  2.  
  3. //inside some method like onDraw
  4.  
  5. int num = new Myapp().get();
  6.  
  7. }
Parsed in 0.010 seconds, using GeSHi 1.0.8.4
Any suggestions?
doubleslash
Developer
Developer
 
Posts: 30
Joined: Fri Feb 13, 2009 6:05 am

Top

Postby doubleslash » Sun Mar 01, 2009 6:28 pm

I found that making the variable static solved the problem.
doubleslash
Developer
Developer
 
Posts: 30
Joined: Fri Feb 13, 2009 6:05 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 11 guests