I want change a value from another activity like this
Main_activity.java
...
long notify_interval = 1000; //ms
...
But, In another activity, called system.java, I have this code
btn_normal.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Main_activity.notify_interval = 1000; // HERE <<--
Toast.makeText(getApplicationContext(), "Interval changed!", Toast.LENGTH_SHORT).show();
}
});
But isn't working, someone tells me that this way never will work. So, what should I do?
--------- UPDATE ---------
Hello, with this trick, I'm able to change long value between activities
public static long notify_interval = 1000;
But, I'm using AlarmManager, when I close the app, instead of using the custom notify_interval that I set, the system is using the default value (1000). So, what should I do to fix it?