1. Check out our companion app, Forums for Android! Download from Google Play

HELP! Control Array???

Discussion in 'Application Development' started by metzyn, Apr 17, 2010.

  1. metzyn

    metzyn New Member
    Thread Starter
    5

    Apr 17, 2010
    2
    0
    5
    I am attempting to create a "control array" similar to that of Visual Basic 6. And I have no clue as how to implement such within Android's Java language. I am really trying to implement a click listener for an object array within a for-loop.

    Here is an example of code I attempted yet continues to cause errors:

    for(final int i = 1; i <= 7; i++){
    imgSkill.setOnLongClickListener(new OnLongClickListener(){
    public boolean onLongClick(View v){
    intCurrentImage = i - 7;
    new AlertDialog.Builder(SoldierActivity.this)
    .setTitle(strSkillTitle[i + (intCurrentTab * 7)])
    .setMessage(strSkillDescription[i + (intCurrentTab * 7)])
    .setNeutralButton("Close", null)
    .setPositiveButton("Reset", new DialogInterface.OnClickListener(){
    public void onClick(DialogInterface dialog, int which){
    intSkills[intCurrentTab][intCurrentImage] = 0;
    updateLayout();
    }
    })
    .show();
    return true;
    }
    });
    }
     

    Advertisement

  2. metzyn

    metzyn New Member
    Thread Starter
    5

    Apr 17, 2010
    2
    0
    5
    Does no one know a solution to my problem?

    Can someone at least point me in the right direction to find an answer?
     
  3. dmitriyk

    dmitriyk Active Member
    18

    Apr 17, 2010
    44
    10
    18
    Software Developer
    Salt Lake City, UT
    What's a "control array"? I haven't used Visual Basic 6.
    And what are the errors your current code is causing?
     

Share This Page

Loading...