コード例 #1
0
  /** Called when the activity is first created */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    Log.d(TAG, "LoaderActivity created");
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.content);

    // Instantiate custom adapter
    mAdapter = new LoaderAdapter();

    // Handle listview and assign adapter
    mListView = (ListView) findViewById(R.id.content_list_view);
    mListView.setAdapter(mAdapter);
    mListView.setVisibility(View.GONE);
    mListView.setOnItemLongClickListener(
        new AdapterView.OnItemLongClickListener() {
          public boolean onItemLongClick(AdapterView parent, View view, int position, long id) {
            selectItem(position);
            return true;
          }
        });

    mStatusLabel = (TextView) findViewById(R.id.content_status_label);
    mStatusLabel.setVisibility(View.VISIBLE);

    String userHash = NavigineApp.Settings.getString("user_hash", "");
    if (userHash.length() == 0) showUserHashDialog();
    else refreshMapList();
  }
コード例 #2
0
  @Override
  public void onPause() {
    Log.d(TAG, "LoaderActivity paused");
    super.onPause();

    mTimerTask.cancel();
    mTimerTask = null;
  }
コード例 #3
0
  @Override
  public void onResume() {
    Log.d(TAG, "LoaderActivity resumed");
    super.onResume();

    // Starting interface updates
    mTimerTask =
        new TimerTask() {
          @Override
          public void run() {
            mHandler.post(mRunnable);
          }
        };
    mTimer.schedule(mTimerTask, 100, 100);
  }
コード例 #4
0
 @Override
 public void onDestroy() {
   Log.d(TAG, "LoaderActivity destroyed");
   super.onDestroy();
 }