Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- WebAppInterface(Context c, Response response) {
- activity = (Activity) c;
- delegate = response;
- context = c;
- }
- /** Show a toast from the web page */
- @JavascriptInterface
- public void getResponse(final String operation, final String response, final String type) {
- final Handler mainHandler = new Handler(context.getMainLooper());
- mainHandler.post(new Runnable() {
- @Override
- public void run() {
- delegate.didGetResponse(operation, response, type);
- Log.d("Success: ", "Im still here"); <-- why am I not back in main thread?
- }
- });
- }
- public interface Response {
- public void didGetResponse(String operation, String response, String type);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement