I have some service that need to start repeatedly by user input or given default value, so i need to add parameter to handle it,
I have tried this:
@ReactMethod
public void start(){
start(1000);
}
@ReactMethod
public void start(int timer){
Intent i = new Intent(reactContext, ServiceUploadData.class);
i.putExtra("Interval", timer);
reactContext.startService(i);
}
but those code show an error
start got 0 arguments, expected 1
anyone can help me?