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 - Global variables?

Global variables?

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

Global variables?

Postby jones » Thu Oct 22, 2009 2:57 pm

hi all together,

i have a serious problem with variables over different functions within the same class:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public class HelloWidget extends AppWidgetProvider {
  2.  
  3.         private static final String TAG = "HelloWidget";
  4.  
  5.         public String timer;
  6.  
  7.  
  8.  
  9.         public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
  10.  
  11.                 Log.d(TAG, "onUpdate");        
  12.  
  13.                 this.timer = "yeahh";
  14.  
  15.         }
  16.  
  17.        
  18.  
  19.         public void onDeleted(Context context, int[] appWidgetIds) {
  20.  
  21.                 Log.d(TAG, "onDeleted");
  22.  
  23.                 Log.d(TAG, this.timer);
  24.  
  25.         }
  26.  
  27.        
  28.  
  29. }
Parsed in 0.014 seconds, using GeSHi 1.0.8.4

This piece of code throws a NullPointerException at line
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. Log.d(TAG, this.timer);
Parsed in 0.010 seconds, using GeSHi 1.0.8.4

I am wondering why it is so difficult to declare variables globally. Am I just used to too different programming languages?

Where is my mistake?

Thanks and cheers
Jonas
jones
Once Poster
Once Poster
 
Posts: 1
Joined: Thu Oct 22, 2009 2:49 pm

Top

Return to Other Coding-Problems

Who is online

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