0
我想爲我的應用程序使用Startapp,我一直在得到這個錯誤,我不知道爲什麼! 錯誤是在這條線構造函數AdPreferences(int,int,String)未定義t startapp?
AdPreferences adPreferences =
new AdPreferences(developers ID,App ID,AdPreferences.TYPE_INAPP_EXIT);
htmlAd = new HtmlAd(this); htmlAd.load(adPreferences, this);
我打消了我的ID
下面是完整的代碼
public class SplashActivity extends WhatsNewActivity implements OnClickListener
{
private Button mButtonPlay;
private HtmlAd htmlAd = null;
@Override
public void onCreate(Bundle icicle)
{
super.onCreate(icicle);
setContentView(R.layout.splash);
mButtonPlay = (Button) findViewById(R.id.button_go);
mButtonPlay.setOnClickListener(this);
ImageView image = (ImageView) findViewById(R.id.image_splash);
image.setImageResource(R.drawable.splash);
AndroidSDKProvider.setTestMode(true);
AndroidSDKProvider.initSDK(this);
AdPreferences adPreferences =
new AdPreferences(xxxxxxxxx,xxxxxxxxx,AdPreferences.TYPE_INAPP_EXIT);
htmlAd = new HtmlAd(this); htmlAd.load(adPreferences, this);
}
@Override
public void onBackPressed() {
if(htmlAd != null) {
htmlAd.show();
}
super.onBackPressed();
}
/**
* {@inheritDoc }
*/
public void onClick(View v)
{
if (v == mButtonPlay)
{
Intent intent = new Intent(this, PaintActivity.class);
startActivity(intent);
}
}
@Override
public int getFirstRunDialogTitleRes()
{
return R.string.first_run_dialog_title;
}
@Override
public int getFirstRunDialogMsgRes()
{
return R.string.first_run_dialog_message;
}
@Override
public int getWhatsNewDialogTitleRes()
{
return R.string.whats_new_dialog_title;
}
@Override
public int getWhatsNewDialogMsgRes()
{
return R.string.whats_new_dialog_message;
}
}
看起來不像構造函數被定義。所以,如果你的代碼是你的代碼,你應該添加它。如果它是一個默認類,你需要改變你的構造函數以匹配已經定義的。 – greedybuddha