Reputation: 542
In worklight, I am using WL.NativePage.show for android native call. As I am doing so much process in activity(native), It throws me error "The application may be doing too much work on its main thread".
As resolution I used threading for calculation(so much process) and It is working OK. But In this case, Native page showed up.
But I just want some calculation on input (From JS) in native and output(At JS) without rendering activity.
...
public class EmbeddedCalculator extends Activity {
public static Boolean isSuccessful = false;
private Calculation calculation = new Calculation();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Runnable runnable = new Runnable() {
@Override
public void run() {
// .. calculation - Higher process ..
}
};
Thread t= new Thread(runnable);
t.start();
}
}
Upvotes: 1
Views: 129
Reputation: 44516
Then why use WL.NativePage at all?
Since you did not mention the actual version of Worklight that you are using, I will just list possible alternatives:
Upvotes: 1