(1)今天又出现了Native method not found的错误,找了半天,JNI中文件名与java中对应,最后发现是改代码的时候忘记加:
static{
System.loadLibrary(“SMS”);
}
(2)将算法代码放到异步任务中进行(作用和开辟一个线程一样)
new AsyncTask<Void, Void, Void>(){
@Override
protected Void doInBackground(Void... arg0) {
// TODO Auto-generated method stub
getUserPitch(userPath,standardPath, userPitch,pitchNum);
return null;
}
//执行结束,UI;
protected void onPostExecute(Void result) {
initView();
}
}.execute();