eclipse startapp广告中的错误

时间:2014-08-28 13:26:02

标签: java android

Eclipse告诉我"此行的多个标记      - 方法init(Context,String,String,boolean)in      类型StartAppSDK不适用于参数      (FlashlightActivity,int,int,boolean)      - 换行符:FlashlightActivity [line:61] -      的onCreate(捆绑)" 问题是 init 。 在这段代码中:

@Override
public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    StartAppSDK.init(this, 107866170, 208658775, true);
            setContentView(R.layout.flashlight);
    button = (ToggleButton) findViewById(R.id.togglebutton);

    final PackageManager pm = context.getPackageManager();
    if (!isCameraSupported(pm)) {
        AlertDialog alertDialog = new AlertDialog.Builder(context).create();
        alertDialog.setTitle("No Camera");
        alertDialog.setMessage("The device's doesn't support camera.");
        alertDialog.setButton(RESULT_OK, "OK",
                new DialogInterface.OnClickListener() {
                    public void onClick(final DialogInterface dialog,
                            final int which) {
                        Log.e("err", "The device's doesn't support camera.");
                    }

1 个答案:

答案 0 :(得分:0)

ID应该是字符串,因此您的init行应该是:

StartAppSDK.init(this, "107866170", "208658775", true);