Skip to content

Commit

Permalink
Merge pull request #7 from AsadAlihp/main
Browse files Browse the repository at this point in the history
Check if it has currentActivity before using getCurrentActivity
  • Loading branch information
killserver authored Dec 26, 2022
2 parents bb66087 + b2a3fb7 commit cdaf22a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public String getName() {

@ReactMethod
public void enabled(boolean _enable) {
if(this.reactContext != null){
if (this.reactContext.hasCurrentActivity()) {
if (_enable) {
this.reactContext.getCurrentActivity().runOnUiThread(new Runnable() {
@Override
Expand Down

0 comments on commit cdaf22a

Please sign in to comment.