Thank you guys, Sorry, it is htest not Hsudoku. How can I instantiated htest in my code? could u please help me out?
On Aug 12, 11:10 am, "Balwinder Kaur (T-Mobile USA)" <balwinder.k...@t- mobile.com> wrote: > Hamed3d, > > Nowhere in your code that you pasted do you have the "final field > hsudoku". If you mean htest instead of hsudoku, then you have not > instantiated htest in the code you have pasted. If you create public > static methods, it would work. > > Balwinder Kaur > Open Source Development Center > ·T· · ·Mobile· stick together > > The views, opinions and statements in this email are those of the > author solely in their individual capacity, and do not necessarily > represent those of T-Mobile USA, Inc. > > On Aug 12, 1:38 am, Hamed3d <hamed.sa...@gmail.com> wrote: > > > Basically, I have two different Activities, one of them has 2 member > > functions which I want to use them in other activities. > > > so here in Splash class activity, I referenced to Htest class: > > > private final Htest htest; > > htest.setNoTitle(); > > > but I get this error: The blank final field hsudoku may not have been > > initialized > > > Please look at the following code and u will see what I mean. > > > here is the activity which has two member functions > > > public class Htest extends Activity implements OnClickListener{ > > > �...@override > > public void onCreate(Bundle savedInstanceState) { > > super.onCreate(savedInstanceState); > > > setNoTitle(); //no Title > > setFullscreen(); //Full screen > > > setContentView(R.layout.main); > > > } > > > } > > > public void setFullscreen() { > > > getWindow().setFlags > > (WindowManager.LayoutParams.FLAG_FULLSCREEN, > > WindowManager.LayoutParams.FLAG_FULLSCREEN); > > } > > > public void setNoTitle() { > > requestWindowFeature(Window.FEATURE_NO_TITLE); > > } > > > } > > > now here is another activity which I want to reference to those member > > functions > > > public class Splash extends Activity { > > > private final Htest htest; //reference to Htest class > > > private Splash_view splashview; > > > public void onCreate(Bundle savedInstanceState) { > > super.onCreate(savedInstanceState); > > > htest.setNoTitle(); // this gives me this error: The blank > > final field hsudoku may not have been initialized > > > //splashview > > > splashview = new Splash_view(this); > > setContentView(splashview); > > splashview.requestFocus(); > > > } --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---