[英]Airpush classes could not be instantiated
I dowloaded the Airpush Bundle SDK 1.0 becuase I want to add banner ads to my app. 我下载了Airpush Bundle SDK 1.0,因为我想在我的应用中添加横幅广告。 I imported the sdk to my project, and I added rules to my manifest.
我将sdk导入到我的项目中,并在规则中添加了规则。
However, when I run my program I do not see any ads. 但是,当我运行我的程序时,我没有看到任何广告。
Every time in the layout manager it says "could not be instantiated" as seen in my screenshot above. 每次在布局管理器中,它都会显示“无法实例化”,如上面的屏幕截图所示。
I tried to delete google play services, and reload it into project, but did not change anything. 我试图删除谷歌播放服务,并将其重新加载到项目中,但没有改变任何东西。
Here's the text of the error message: 这是错误消息的文本:
The following classes could not be instantiated:
- com.bplxjxdpse.achmyqxdlf225456.AdView (Open Class, Show Error Log)
See the Error Log (Window > Show View) for more details.
Tip: Use View.isInEditMode() in your custom views to skip code when shown in Eclipse
Send this to their developers, they should be skipping a few things in their class and draw something for the developers to see if editMode
is active, just like the error says. 发送给他们的开发人员,他们应该跳过他们班级中的一些东西,并为开发人员绘制一些东西,看看
editMode
是否处于活动状态,就像错误所说的那样。 You can't do much unless you have access to the sources. 除非您有权访问这些来源,否则您无法做很多事情。
@Override
public void draw(Canvas canvas) {
super.draw(canvas);
if (isInEditMode()) {
// This will be shown in XML layout design
Paint mTitlePaint = new Paint();
mTitlePaint.setColor(Color.BLACK);
mTitlePaint.setStyle(Paint.Style.FILL);
mTitlePaint.setAntiAlias(true);
mTitlePaint.setTextSize(40);
String mTitle = "Ad will appear here";
float xPos = ((getMeasuredWidth() - mTitlePaint.measureText(mTitle)) / 2.0f);
float yPos = (getMeasuredHeight() / 2.0f);
float titleHeight = Math.abs(mTitlePaint.descent() + mTitlePaint.ascent());
yPos += titleHeight / 2.0f;
canvas.drawText(mTitle, xPos, yPos, mTitlePaint);
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.