its my AplicationClass ==>
@Override
public void onCreate() {
super.onCreate();
mydRef = FirebaseDatabase.getInstance().getReference();
tipDondur();
}
public static Context context() {
return app.getApplicationContext();
}
public boolean internetAktif() {
final ConnectivityManager connectivityManager = ((ConnectivityManager) app
.getApplicationContext()
.getSystemService(Context.CONNECTIVITY_SERVICE));
return connectivityManager.getActiveNetworkInfo() != null &&
connectivityManager.getActiveNetworkInfo().isConnected();
}
and when call to internetAktif function from other class ==>
App app = (App) getApplicationContext();
Log.d("", "İnternet durum: " + app.internetAktif());
send error ==>
Caused by: java.lang.NullPointerException at com.example.ercana.yemekevdefb.App.internetAktif(App.java:38) at com.example.ercana.yemekevdefb.Splash.onCreate(Splash.java:31)
what does it mean? How i solve this problem ?