title: Save the position using Shared preferences in android
body: <p>I have to develop one android application.Here i have to set the position here:</p>
  
  <pre><code>ar = new LinearLayout(this);
  ar.setOrientation(LinearLayout.VERTICAL);
  ar.setPadding(3, 3, 3, 3);
  ar.setLayoutParams(artiLayoutParams);
  ar.setGravity(Gravity.CENTER);
  ar.setBackgroundColor(Color.parseColor("#666666"));
  ar.setBackgroundDrawable(getResources().getDrawable(R.drawable.list_selector));
  ar.setId(position);
  position++;
  ar.setOnClickListener(mArticleClick);
  </code></pre>
  
  <p>After that i have to get the position and display the list of images depends upon these position.</p>
  
  <pre><code>    @Override
      public void onClick (View v) {
  
          int object = v.getId();
  
          String articletitle = Appscontent.Sub_arraylist.get(object).toString();
          String articleimage = Appscontent.Sub_arraylistimage.get(object).toString();
  
          Intent in = new Intent(MainActivity.this, SubCate.class);
          in.putExtra("Title", articletitle);
          in.putExtra("Image", articleimage);
  
          startActivity(in);
      }
  };
  </code></pre>
  
  <p>Here i have to save these postion using shared preferences or global variable..how can i save it ????</p>
  
  <p>pls give me some idea ????</p>