direct Global viable access using an "Application" class?
i want to setup a global variable class holder extending "Application" like this one here:
http://trace.adityalesmana.com/2010开发者_高级运维/08/declare-global-variable-in-android-via-android-app-application/
my question is it possible to access the viable directly instead of calling a method?
(going by the link's example) can "islogin" be declared as:
public boolean isLogin = true;
then accessed like this?:
if (!combankDroid.isLogin) {
You can do what you want: global variables on Application objects work just fine.
The actual solution to your issue is to make the MediaPlayer instance a variable of a Service and then connect to that to fetch/control the MediaPlayer.
精彩评论