So there are basically two Activties. The first one has a TextView which I want to update, while the second activity is running. (therefore the first activity is onPause()) . You are able to see from the second activity the first activities TextView, because the second one isFloating, and the layout size is just about the half of the first activity (first activity takes out the whole screen). So whenever I press a button on the second activity which should update the TextView on the first Activity, the app crashes. Does anyone have an idea how to fix this. :)? ty for helping me.
logcat:
08-07 22:03:03.454 6132-6132/at.lorenzdirry.pokmonclick D/AndroidRuntime: Shutting down VM
08-07 22:03:03.455 6132-6132/at.lorenzdirry.pokmonclick E/AndroidRuntime: FATAL EXCEPTION: main
Process: at.lorenzdirry.pokmonclick, PID: 6132
Theme: themes:{default=overlay:com.cyngn.themes.yu, iconPack:com.cyngn.themes.yu, fontPkg:com.cyngn.hexo, com.android.systemui=overlay:com.cyngn.themes.yu, com.android.systemui.navbar=overlay:com.cyngn.themes.yu}
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
at at.lorenzdirry.pokmonclick.StoreActivity$2.onClick(StoreActivity.java:72)
at android.view.View.performClick(View.java:5204)
at android.view.View$PerformClick.run(View.java:21158)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5461)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)