开发者

Setting a Variable Once... I don't Know How to Explain (Android Projgramming)

开发者 https://www.devze.com 2023-01-20 00:59 出处:网络
This is kind of hard to explain, so i\'ll try the best I can to inform you on 开发者_如何学运维my problem. I have a variable that changes every now and then. In the main app activity i have

This is kind of hard to explain, so i'll try the best I can to inform you on 开发者_如何学运维my problem. I have a variable that changes every now and then. In the main app activity i have

int count = 0;

(count is the variable) I would like to only set that at the very beginning. The first time a viewer opens it up I want to set it to 0. After that, I want to save it every time the viewer leaves, and load it when the viewer opens the app back up.


you write that before any of your function begins.

like

private int count=0;

public static void FunctionBegins() { ... }

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号