global variables - Android with a Globally accessible class in all activities -


i having trouble sharing globalvaribale class:

here class:

public class globalobjects extends application {  private context context;  public globalobjects(context context) {     this.context = context; }  // variables  private network network;   // getters , setters  public context getcontext() {     return context; }  public void setcontext(context context) {     this.context = context; }  public network getnetwork() {     return network; }  public void setnetwork(network network) {     this.network = network; } } 

and here android manifest file:

   <application     android:name="globalobjects"     android:allowbackup="true"     android:icon="@drawable/ic_launcher"     android:label="@string/app_name"     android:theme="@style/apptheme" > 

i have added global object existing application tag. when run class gives errors:

08-07 21:19:58.867: e/androidruntime(3588): fatal exception: main 08-07 21:19:58.867: e/androidruntime(3588): java.lang.runtimeexception: unable instantiate application com.example.electronicmenu.globalobjects: java.lang.classnotfoundexception: com.example.electronicmenu.globalobjects 


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -