
我下载了Airpush Bundle SDK 1.0,因为我想在我的应用程序中添加横幅广告。我将sdk导入到我的项目中,并向清单中添加了规则。
但是,当我运行我的程序时,我没有看到任何广告。
每次在布局管理器中,它都会显示“无法实例化”,如我上面的屏幕截图所示。
我试图删除google play服务,并将其重新加载到项目中,但没有任何改变。
以下是错误消息的文本:
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发布于 2015-04-26 04:09:46
把这个发给他们的开发人员,他们应该跳过他们的类中的一些东西,并为开发人员绘制一些东西来查看editMode是否处于活动状态,就像错误所说的那样。除非你有权访问源代码,否则你不能做很多事情。
@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);
}
}https://stackoverflow.com/questions/29688624
复制相似问题