对于Object类型,onStart(Context,int)方法未定义

时间:2014-12-05 10:20:45

标签: android int oncreate android-context

这是程序代码。请帮帮我。

public void onStart(Context paramIntent, int paramInt)
      {
        //super.onStart(paramIntent,paramInt);//ERROR IN THIS LINE
        this.dbhelper = new DBHelper(getApplicationContext());
        this.db = this.dbhelper.getReadableDatabase();
        this.c = this.dbhelper.getPlaces(this.db);
        this.locManager = ((LocationManager)getSystemService("location"));
        this.db.close();
        this.am = ((AudioManager)getSystemService("audio"));
        if (this.locManager != null)
        {
          if (!this.locManager.isProviderEnabled("gps"))
          {
            startActivity(new Intent("android.settings.LOCATION_SOURCE_SETTINGS"));
            Toast.makeText(paramIntent, "Enable Gps!", 1).show();
          }
          this.locManager.requestLocationUpdates("gps", 300000L, 10.0F, this);
        }
      }

1 个答案:

答案 0 :(得分:-1)

@Piyush Gupta写道:

  

应该是:

 public void onStart(Intent intent, int paramInt)
     

不是

public void onStart(Context paramIntent, int paramInt)