How to set the new data that was entered by the user in the list item?
<p>I am trying to do this : when the user clicks the list item the Activity level fore instance a dialog will appear then the user will choose "update" his activity level , and then I want to put this value in the row_data ,its possible to do that? and how i can do it ? I tried this approach:</p>

<pre><code> public void onClick(DialogInterface dialog, int which) {
 profile_data[4]=new ProfileListItems(R.drawable.arrow_left,Activity_level[which],"ActivityLevel"); 
</code></pre>

<p>but it didnt work </p>

<p><img src="http://i.stack.imgur.com/LITKY.png" alt="enter image description here"></p>

<pre><code>public class ProfileView extends Activity {

private ListView mList;
private Profile []   profile_data;
 private String[] Activity_level;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
       profile_data= new Profile[]
        {
            new Profile("Name",StaticPreferences.getName(this),R.drawable.arrow_left),
            new Profile("Age", StaticPreferences.getAge(this),R.drawable.arrow_left) ,
            new Profile("Height",StaticPreferences.getHeight(this),R.drawable.arrow_left),
            new Profile("Weight", StaticPreferences.getWeight(this),R.drawable.arrow_left),
            new Profile("ActivityLevel",StaticPreferences.getActivity(this),R.drawable.arrow_left)
    };

    ProfileAdapter adapter = new ProfileAdapter(this,R.layout.row,profile_data);

    mList=(ListView)findViewById(R.id.profile_list);
    View header = (View)getLayoutInflater().inflate(R.layout.header, null);
    mList.addHeaderView(header);
    mList.setAdapter(adapter);
     mList .setOnItemClickListener(new OnItemClickListener() {
           public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {

               if( position==2) 
                   showHeightDialog();

               else if(position==3)
                   showWeightDialog();
               else if(position==4)

                showActivityDialog();
                          }
                       }
               private void showActivityDialog()
                {        int j=0;
   Activity_level=getResources().getStringArray(R.array.Activity_Level_Array);

  AlertDialog.Builder localBuilder = new AlertDialog.Builder(this);
  localBuilder.setTitle(" choose your Activity Level);
  localBuilder.setSingleChoiceItems(Activity_level,j, new DialogInterface.OnClickListener() {

         @Override
          public void onClick(DialogInterface dialog, int which) {

            saveActivityLevel(Activity_level[which]); // store the user activity level

                           profile_data[4]=new Profile("ActivityLevel",Activity_level[which],R.drawable.arrow_left);
                           showMessage("your activity level updated");
    }
            });
                          localBuilder.setPositiveButton("OK", null);
                          this.Activity_LevelDialog = localBuilder.create();
                          this.Activity_LevelDialog.show();
                                }
                           private void saveActivityLevel(String   Activity_level)
                          {
                  StaticPreferences.setActivityLevel(this, Activity_level);
                                             }
                                    }
</code></pre>
