title: How to get uid value of an android application from a list displayed in a spinner?
body: <p>I am developing a small application which displays the installed application as a list in a spinner. Only the application name is displayed as spinner values. Whenever I select an application from spinner I need to retrieve the UID of the selected application. How can I implement the function?</p>
  
  <p>The following is my code for getting the application name from the spinner</p>
  
  <pre><code>appspinner.setOnItemSelectedListener(new OnItemSelectedListener() {
  
          @Override
          public void onItemSelected(AdapterView&lt;?&gt; parent, View arg1,
                  int app_pos, long app_id) {
              // TODO Auto-generated method stub
              String app_selected=parent.getItemAtPosition(app_pos).toString();
  
          }
  
          @Override
          public void onNothingSelected(AdapterView&lt;?&gt; arg0) {
              // TODO Auto-generated method stub
              return;
          }
      });
  </code></pre>
  
  <p>The installed application is stored in a list using the PackageManager class and using PackageInfo class I am getting the name of the application. </p>