难得糊涂125
难得糊涂125
  • 发布:2017-05-09 18:26
  • 更新:2017-05-09 18:26
  • 阅读:1417

如何用native.js 在js方法里面导入内部抽象类

分类:Native.js

import com.landicorp.android.eptapi.device.Printer;
import com.landicorp.android.eptapi.exception.RequestException;

public class Print {
/**

  • 该方法实现过程:实例化Printer的内部抽象类Progress ,并重新其抽象方法,然后调用其start方法
  • */
    public static void printContent(){
    Printer.Progress progress = new Printer.Progress() {
    @Override
    public void doPrint(Printer printer) throws Exception {
    printer.println("--------------------------------");
    printer.feedLine(8);
    }
    @Override
    public void onCrash() {

        }  
        @Override  
        public void onFinish(int code) {  
    
        }  
    };  
    try {  
        progress.start();  
    } catch (RequestException e) {  
        // TODO 自动生成的 catch 块  
        e.printStackTrace();  
    }  

    }
    }

请教大神如何用native.js实现上述方法

2017-05-09 18:26 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复