public static Bitmap bmp;
bmp = BitmapFactory.decodeResource(this.getResources(), R.drawable.nehe);
上面代码的错误“令牌上的语法错误“;”,,预期”我已经在后面加上了一个分号,bmp
但仍然发生错误
这是完整的代码:
public class CustomActivity extends AndARActivity {
ARToolkit artoolkit;
CustomObject someObject;
CustomObject1 someObject1;
public static Bitmap bmp = BitmapFactory.decodeResource(this.getResources(), R.drawable.nehe);
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
CustomRenderer renderer = new CustomRenderer();
super.setNonARRenderer(renderer);
try {
//register a object for each marker type
artoolkit = super.getArtoolkit();
someObject = new CustomObject
("test", "androidpirate.patt", 80.0, new double[]{0,0});
artoolkit.registerARObject(someObject);
someObject = new CustomObject
("test", "andson.patt", 80.0, new double[]{0,0});
artoolkit.registerARObject(someObject);
someObject1 = new CustomObject1("test","andrev.patt", 80.0, new double[]{0,0});
artoolkit.registerARObject(someObject1);
someObject1 = new CustomObject1("test","androidpat.patt", 80.0, new double[]{0,0});
artoolkit.registerARObject(someObject1);
} catch (AndARException ex){
//handle the exception, that means: show the user what happened
System.out.println("");
}
startPreview();
}
@Override
public void uncaughtException(Thread thread, Throwable ex) {
Log.e("AndAR EXCEPTION", ex.getMessage());
finish();
}
}