我收到了这个错误.任何的想法 ?
12-29 22:24:46.087: WARN/dalvikvm(2307): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
12-29 22:24:46.147: ERROR/AndroidRuntime(2307): FATAL EXCEPTION: main
12-29 22:24:46.147: ERROR/AndroidRuntime(2307): java.lang.NullPointerException
12-29 22:24:46.147: ERROR/AndroidRuntime(2307): at android.opengl.GLSurfaceView.surfaceCreated(GLSurfaceView.java:471)
12-29 22:24:46.147: ERROR/AndroidRuntime(2307): at android.view.SurfaceView.updateWindow(SurfaceView.java:532)
12-29 22:24:46.147: ERROR/AndroidRuntime(2307): at android.view.SurfaceView.dispatchDraw(SurfaceView.java:339)
12-29 22:24:46.147: ERROR/AndroidRuntime(2307): at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
12-29 22:24:46.147: ERROR/AndroidRuntime(2307): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
12-29 22:24:46.147: ERROR/AndroidRuntime(2307): at android.view.View.draw(View.java:6743)
12-29 22:24:46.147: ERROR/AndroidRuntime(2307): at android.widget.FrameLayout.draw(FrameLayout.java:352)
12-29 22:24:46.147: ERROR/AndroidRuntime(2307): at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
12-29 22:24:46.147: ERROR/AndroidRuntime(2307): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
12-29 22:24:46.147: ERROR/AndroidRuntime(2307): at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
12-29 22:24:46.147: ERROR/AndroidRuntime(2307): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
12-29 22:24:46.147: ERROR/AndroidRuntime(2307): …Run Code Online (Sandbox Code Playgroud) 我们开发了一个带有游戏2.2.3的Web应用程序,并希望对其进行模糊处理.我正在尝试使用sbt-proguard插件.我将下面的行放在PROJECT_FOLDER/project/plugins.sbt文件中
addSbtPlugin("com.typesafe.sbt" % "sbt-proguard" % "0.2.2")
Run Code Online (Sandbox Code Playgroud)
并将下面的行放在PROJECT_FOLDER/build.sbt文件中
proguardSettings
ProguardKeys.options in Proguard ++= Seq("-dontnote", "-dontwarn", "-ignorewarnings")
ProguardKeys.options in Proguard += ProguardOptions.keepMain("Application")
inConfig(Proguard)(javaOptions in ProguardKeys.proguard := Seq("-Xmx2g"))
Run Code Online (Sandbox Code Playgroud)
当我在播放控制台和插件网站上说dist时,我不确定proguard是否正常工作他们说调用proguard:proguard.当我在play console上编写proguard:proguard时,Play会给出错误,如下所示
[info] Reading program jar [/Users/kamil/DEVELOPMENT/play-2.2.3/repository/local/net.sf.ehcache/ehcache-core/2.6.6/jars/ehcache-core.jar] (filtered)
[info] Reading program jar [/Users/kamil/DEVELOPMENT/play-2.2.3/repository/cache/org.json/json/jars/json-20140107.jar] (filtered)
[info] Reading library jar [/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/jce.jar]
[info] Reading library jar [/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/rt.jar]
[error] Error: The output jar is empty. Did you specify the proper '-keep' options?
[trace] Stack trace suppressed: run …Run Code Online (Sandbox Code Playgroud) 我想在矩形上绘制一个位图.我使用以下值:
this.meshWidth = 1;
this.meshHeight = 1;
this.verts = new float[8];
this.points[0].x = (float)(this.getWidth()/4);
this.points[0].y = (float)(this.getHeight()/4);
this.points[1].x = (float)(this.points[0].x+this.getWidth()/2);
this.points[1].y = (float)(this.points[0].y);
this.points[2].x = (float)(this.points[0].x);
this.points[2].y = (float)(this.points[0].y+this.getHeight()/2);
this.points[3].x = (float)(this.points[1].x);
this.points[3].y = (float)(this.points[2].y);
Run Code Online (Sandbox Code Playgroud)
points数组是我的顶点数组.
我的onDraw方法
public void onDraw(Canvas canvas){
//canvas.drawBitmap(bitmap, 20,20, null);
Paint paint = new Paint();
paint.setColor(Color.BLUE);
canvas.drawLine(this.points[0].x, this.points[0].y, this.points[1].x, this.points[1].y, paint);
canvas.drawLine(this.points[1].x, this.points[1].y, this.points[3].x, this.points[3].y, paint);
canvas.drawLine(this.points[3].x, this.points[3].y, this.points[2].x, this.points[2].y, paint);
canvas.drawLine(this.points[2].x, this.points[2].y, this.points[0].x, this.points[0].y, paint);
canvas.drawBitmapMesh(this.bitmap, meshWidth, meshHeight, verts, 0, null, 0, null);
}
Run Code Online (Sandbox Code Playgroud)
输出就是这个 …
window.history.length在我们的项目中,值非常重要,可以在浏览器上单击检测后退按钮.但是我意识到window.history.length没有通过50.如何解决这个问题?谢谢你的帮助.
我正在使用带有gson的领域.我有一个模态,其中包含一个int类型字段列表.Realm不支持当前的基元列表.要解决这个问题,有一个解决方案.我创建了我的RealmInt类.
import io.realm.RealmObject;
public class RealmInt extends RealmObject {
private int val;
public int getVal() {
return val;
}
public void setVal(int val) {
this.val = val;
}
}
Run Code Online (Sandbox Code Playgroud)
我有一个类似的大型模态对象..
public class Product extends RealmObject {
@PrimaryKey
private int productID;
private int priority;
private boolean isFavourite;
.....
.....
.....
private RealmList<Document> documents;
private RealmList<ProductInfoGroup> productInfoGroups;
private RealmList<RealmInt> categories;
Run Code Online (Sandbox Code Playgroud)
我必须将下面的json数组反序列化为Product modals.
[{
"productID": 776,
"categories": [
35
],
"name": "",
"priority": 3,
......
"status": 2,
"documents": [
{
"documentID": 74,
"productID": …Run Code Online (Sandbox Code Playgroud) 我写了一个opengl android代码来显示一个正方形的位图.但是位图是相反的.当我将纹理数组组合更改为注释代码时,它被正确绘制.但我坚持我的纹理数组必须如下所示.我错了吗?
Run Code Online (Sandbox Code Playgroud)/** The initial vertex definition */ private float vertices[] = { -1.0f, 1.0f, 0.0f, //Top Left -1.0f, -1.0f, 0.0f, //Bottom Left 1.0f, -1.0f, 0.0f, //Bottom Right 1.0f, 1.0f, 0.0f //Top Right }; /** Our texture pointer */ private int[] textures = new int[1]; /** The initial texture coordinates (u, v) */ private float texture[] = { //Mapping coordinates for the vertices // 1.0f, 0.0f, // 1.0f, 1.0f, // 0.0f, 1.0f, // 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, …
我有一个活动,有一个surfaceview捕获整个屏幕.我想在surfaceview上放一个adob广告.我找到了这个链接,但它不起作用.任何的想法 ?