关于Unity调用android jar 求大神看下代码

需要用unity去调用android的jar jar里面是个浮动框的代码 浮动框的图片打包在assets里面

public class TTest extends UnityPlayerActivity { InterFace inter; Put p = new Put; @Override protected void onCreateBundle savedInstanceState { super.onCreatesavedInstanceState; } public void Input{ p.Dosomenull, inter; }
}

一下是浮动框代码

public Put extend Activity{
public void DosomeActivity activity,Inter inter{ Log.i("TEST","------>") display = Put.this.getWindowManager.getDefaultDisplay; mWM = WindowManager Put.this.getSystemServicePut.this.WINDOW_SERVICE; ivCursor = new ImageViewPut.this; try { Drawable drawable = Drawable.createFromStreamPut.this.getAssets.open"tom.jpg", "tom"; ivCursor.setImageDrawabledrawable; //ivCursor.setBackgroundnew BitmapDrawableBitmapFactory.decodeStreamactivity.getAssets.open"Tom.jpg"; } catch IOException e { // TODO Auto-generated catch block e.printStackTrace; } //ivCursor.setImageResourceMResource.getIdByNameactivity.getApplication,"drawable","tom"; mParams = new WindowManager.LayoutParams;// 对ivCursor对象的参数描述对象 mParams.height = WindowManager.LayoutParams.WRAP_CONTENT; mParams.width = WindowManager.LayoutParams.WRAP_CONTENT; mParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;// 设置成不能获取焦点 mParams.type = LayoutParams.TYPE_PHONE; // 设置图片格式,效果为背景透明 mParams.format = PixelFormat.RGBA_8888; mParams.gravity = Gravity.TOP | Gravity.LEFT; mParams.x = 0;// 相对于屏幕原点的x轴距离 mParams.y = 0;// 相对于屏幕原点的y轴距离 System.out.println"<-----"; mWM.addViewivCursor, mParams; }

}

就这样值打出第一个log 就完事了 那个浮动框也没显示 这是怎么回事啊 求大神帮忙解释下啊

发表评论

电子邮件地址不会被公开。 必填项已用*标注