HELP! Control Array???


Last Updated:

  1. metzyn

    metzyn New Member This Topic's Starter

    Joined:
    Apr 17, 2010
    Messages:
    2
    Likes Received:
    0
    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 This Topic's Starter

    Joined:
    Apr 17, 2010
    Messages:
    2
    Likes Received:
    0
    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

    Joined:
    Apr 17, 2010
    Messages:
    44
    Likes Received:
    10
    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...