2

我设法使用 Callable 将我的过程传递给另一个类,然后该类在完成后调用它。该类创建了一个 String 的 HashMap,我希望能够将其传递给可调用过程,但我无法弄清楚:S

passes the procedure to the class
stockDisplaying = new SQLStatements().LoadAllDrinks(this, new Callable<Integer>() {
            public Integer call() {
                return callWhenDone(null);
           }
        });

the procedure I'm passing I want to be able to send to HashMap to
public int callWhenDone(HashMap<String, String> map){
    Log.d("StockActivity", "omfg this works");
    return 0;
}

Where the class calls the procedure and should send the HashMap
protected void onPostExecute(String file_url) {
        try {
            callWhenDone.call();
        } catch (Exception e) {
            Log.d("LoadAllDrinks", "Exception" + e);
        }
}
4

0 回答 0