File tree Expand file tree Collapse file tree 1 file changed +22
-8
lines changed
android/src/main/java/com/instabug/reactlibrary Expand file tree Collapse file tree 1 file changed +22
-8
lines changed Original file line number Diff line number Diff line change @@ -617,12 +617,17 @@ public void showIntroMessage() {
617
617
* or RGB color values
618
618
*/
619
619
@ ReactMethod
620
- public void setPrimaryColor (int primaryColor ) {
621
- try {
622
- mInstabug .setPrimaryColor (primaryColor );
623
- } catch (Exception e ) {
624
- e .printStackTrace ();
625
- }
620
+ public void setPrimaryColor (final int primaryColor ) {
621
+ new Handler (Looper .getMainLooper ()).post (new Runnable () {
622
+ @ Override
623
+ public void run () {
624
+ try {
625
+ mInstabug .setPrimaryColor (primaryColor );
626
+ } catch (Exception e ) {
627
+ e .printStackTrace ();
628
+ }
629
+ }
630
+ });
626
631
}
627
632
628
633
/**
@@ -831,7 +836,7 @@ public void setInvocationEvents(ReadableArray invocationEventValues) {
831
836
try {
832
837
Object [] objectArray = ArrayUtil .toArray (invocationEventValues );
833
838
String [] stringArray = Arrays .copyOf (objectArray , objectArray .length , String [].class );
834
- ArrayList <InstabugInvocationEvent > parsedInvocationEvents = new ArrayList <>();
839
+ final ArrayList <InstabugInvocationEvent > parsedInvocationEvents = new ArrayList <>();
835
840
836
841
Log .d (TAG , Arrays .toString (stringArray ) + " " + INVOCATION_EVENT_FLOATING_BUTTON );
837
842
@@ -857,7 +862,16 @@ public void setInvocationEvents(ReadableArray invocationEventValues) {
857
862
break ;
858
863
}
859
864
}
860
- BugReporting .setInvocationEvents (parsedInvocationEvents .toArray (new InstabugInvocationEvent [0 ]));
865
+ new Handler (Looper .getMainLooper ()).post (new Runnable () {
866
+ @ Override
867
+ public void run () {
868
+ try {
869
+ BugReporting .setInvocationEvents (parsedInvocationEvents .toArray (new InstabugInvocationEvent [0 ]));
870
+ } catch (Exception e ) {
871
+ e .printStackTrace ();
872
+ }
873
+ }
874
+ });
861
875
} catch (Exception e ) {
862
876
e .printStackTrace ();
863
877
}
You can’t perform that action at this time.
0 commit comments