Ejemplo n.º 1
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.subject);
   Bundle bundle = getIntent().getExtras();
   url = bundle.getString("url");
   itemITeye = new NewItemITeye();
   subjectAdapter = new SubjectAdapter(this);
   mXlistView = (XListView) findViewById(R.id.id_xlistView);
   mXlistView.setPullRefreshEnable(this);
   mXlistView.setPullLoadEnable(this);
   mXlistView.setRefreshTime(AppUtil.getRefreashTime(this, Constant.NEWS_TYPE_SUBJECTS));
   mXlistView.setOnItemClickListener(
       new AdapterView.OnItemClickListener() {
         @Override
         public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
           NewsItem newsItem = newsItems.get(position - 1);
           String url = newsItem.getLink();
           Intent intent = new Intent(SubjectsActivity.this, NewsContentActivity.class);
           intent.putExtra("url", url);
           intent.putExtra("select", 5);
           startActivity(intent);
         }
       });
   if (isFirstIn) {
     /** 进来时直接刷新 */
     mXlistView.startRefresh();
     isFirstIn = false;
   } else {
     mXlistView.NotRefreshAtBegin();
   }
   mXlistView.setAdapter(subjectAdapter);
 }
Ejemplo n.º 2
0
  private void initAttentionCompanyView() {

    if (attentionCompanies != null && attentionCompanies.size() > 0) {
      myAttentionCompanyAdapter.getDate(MyGzActivity.this, attentionCompanies);
      xlv_my_company.setAdapter(myAttentionCompanyAdapter);
      myAttentionCompanyAdapter.notifyDataSetChanged();
    } else {
      Toast.makeText(MyGzActivity.this, R.string.job_no_info, Globals.TOAST_SHORT).show();
    }
  }