Ejemplo n.º 1
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    // listOfSongs = getListOfSongs();
    // for (Song song : listOfSongs) {
    // Toast.makeText(getApplicationContext(), song.toString(),
    // Toast.LENGTH_LONG).show();
    // }

    // Get a handle to the activity update list
    mStatusListView = (ListView) findViewById(R.id.log_listview);
    mStatusAdapter = new ArrayAdapter<Spanned>(this, R.layout.item_layout, R.id.log_text);
    mStatusListView.setAdapter(mStatusAdapter);
    mBroadcastManager = LocalBroadcastManager.getInstance(this);
    mBroadcastFilter = new IntentFilter(ActivityUtils.ACTION_REFRESH_STATUS_LIST);
    mBroadcastFilter.addCategory(ActivityUtils.CATEGORY_LOCATION_SERVICES);

    mDetectionRequester = new DetectionRequester(this);
    mDetectionRemover = new DetectionRemover(this);

    mLogFile = LogFile.getInstance(this);

    // for location
    locationClient = new LocationClient(this, this, this);
    // creating request object with some of parameters set
    locationRequest =
        LocationRequest.create()
            .setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY)
            .setInterval(UPDATE_INTERVAL);
  }