Commit 51215c6 1 parent 9a0fb19 commit 51215c6 Copy full SHA for 51215c6
File tree 1 file changed +3
-5
lines changed
holocron/src/main/java/com/ak93/holocron
1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ public class Holocron {
29
29
private static final int HOLOCRON_RESPONSE_OBJECTS_REMOVED = 502 ;
30
30
31
31
private Context mContext ;
32
- private HolocronResponseHandler mCallback ;
33
32
private Configuration mConfiguration ;
34
33
private Gson mGson ;
35
34
private boolean initialized = false ;
@@ -57,19 +56,18 @@ public Holocron(Context context){
57
56
* Asynchronous constructor. Use this constructor to avoid having your main thread execution delayed.
58
57
* @param context Activity or application Context
59
58
* @param callback A response callback handler, that will receive a callback when Holocron
60
- * has been initialized.
59
+ * has been initialized. Null can be passed if no response is required.
61
60
*/
62
- public Holocron (final Context context , HolocronResponseHandler callback ){
61
+ public Holocron (final Context context , @ Nullable final HolocronResponseHandler callback ){
63
62
mContext = context ;
64
- mCallback = callback ;
65
63
mGson = new Gson ();
66
64
67
65
new Thread (new Runnable () {
68
66
@ Override
69
67
public void run () {
70
68
mForce = new Force (context );
71
69
readConfiguration ();
72
- mCallback .onHolocronResponse (HOLOCRON_RESPONSE_INITIALIZED ,null );
70
+ if ( callback != null ) callback .onHolocronResponse (HOLOCRON_RESPONSE_INITIALIZED ,null );
73
71
}
74
72
}).start ();
75
73
}
You can’t perform that action at this time.
0 commit comments