示例#1
0
 protected void onActivityResult(int requestCode, int resultCode, Intent data) {
   super.onActivityResult(requestCode, resultCode, data);
   if (resultCode == RESULT_OK) {
     new TheTask().execute();
   }
 }
示例#2
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.poll_list);

    mTeamId = LoginAct.teamId;
    mClubId = LoginAct.clubId;

    mPoll = new HashMap<String, String>();
    mPollList = new ArrayList<HashMap<String, String>>();

    lblPollQ = (TextView) findViewById(R.id.lblPollQ);

    lblPollOption1 = (TextView) findViewById(R.id.lblPollOption1);
    lblPollOption2 = (TextView) findViewById(R.id.lblPollOption2);
    lblPollOption3 = (TextView) findViewById(R.id.lblPollOption3);

    lblPollValue1 = (TextView) findViewById(R.id.lblPollValue1);
    lblPollValue2 = (TextView) findViewById(R.id.lblPollValue2);
    lblPollValue3 = (TextView) findViewById(R.id.lblPollValue3);

    lstPoll = (ListView) findViewById(R.id.lstPoll);

    btnAdd = (Button) findViewById(R.id.btnAddPoll);

    bodyLayout = (LinearLayout) findViewById(R.id.bodyLayout);

    if (LoginAct.roleId.equals("4")) {
      btnAdd.setVisibility(View.GONE);
    }

    lstPoll.setDividerHeight(0);
    lstPoll.setOnItemClickListener(
        new OnItemClickListener() {
          public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            // TODO Auto-generated method stub
            HashMap<String, String> poll = mPollList.get(position);
            String isActive = poll.get("isActive");

            if (!Boolean.parseBoolean(isActive) && LoginAct.roleId.equals("4")) {
              TeamAppAlerts.showMessageDialog(PollListAct.this, "Poll Is Inactive");
              return;
            }

            Intent intent = new Intent().setClass(PollListAct.this, PollDetailsAct.class);
            intent.putExtra("position", position);
            intent.putParcelableArrayListExtra(
                "pollList", (ArrayList<? extends Parcelable>) mPollList);
            startActivityForResult(intent, 0);
          }
        });

    btnAdd.setOnClickListener(
        new OnClickListener() {

          public void onClick(View v) {
            // TODO Auto-generated method stub
            Intent intent = new Intent().setClass(PollListAct.this, AddPollAct.class);
            startActivityForResult(intent, 0);
          }
        });

    new TheTask().execute();
  }
示例#3
0
 @Override
 public void onConfigurationChanged(Configuration newConfig) {
   super.onConfigurationChanged(newConfig);
 }