mirror of
https://codeberg.org/gitnex/GitNex.git
synced 2024-12-16 15:48:13 +08:00
parent
6a3a1690bb
commit
0dc593e34e
@ -166,11 +166,18 @@ GitNex use all the default icons provided with Android Studio licensed under Apa
|
|||||||
App Context should be stored at the beggining once in `appCtx`.
|
App Context should be stored at the beggining once in `appCtx`.
|
||||||
Current Context should be stored at the beggining once in `ctx`.
|
Current Context should be stored at the beggining once in `ctx`.
|
||||||
|
|
||||||
appCtx:
|
appCtx example in fragment(change to getApplicationContext in activity):
|
||||||
```
|
```
|
||||||
private Context appCtx;
|
private Context appCtx;
|
||||||
|
|
||||||
appCtx = getApplicationContext();
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
appCtx = getContext();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
ctx example:
|
||||||
|
```
|
||||||
|
final Context ctx = LoginActivity.this;
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Static Variables
|
#### Static Variables
|
||||||
|
Loading…
Reference in New Issue
Block a user