title: android.content.pm.PackageManager$NameNotFoundException:
body: <p>I am creating an app for home automation. When the app is running on smartphone(os kitkat) I am getting the exception:</p>
  
  <blockquote>
    <p>android.content.pm.PackageManager$NameNotFoundException:</p>
  </blockquote>
  
  <p>This is the log</p>
  
  <pre><code>09-21 17:55:25.299 2550-2550/amrita.edu.ha W/System.err: android.content.pm.PackageManager$NameNotFoundException: 
  09-21 17:55:25.300 2550-2550/amrita.edu.ha W/System.err:     at android.app.ApplicationPackageManager.getApplicationInfo(ApplicationPackageManager.java:227)
  09-21 17:55:25.300 2550-2550/amrita.edu.ha W/System.err:     at android.app.ApplicationPackageManager.getResourcesForApplication(ApplicationPackageManager.java:786)
  09-21 17:55:25.300 2550-2550/amrita.edu.ha W/System.err:     at android.widget.TextView.&lt;init&gt;(TextView.java:1323)
  09-21 17:55:25.300 2550-2550/amrita.edu.ha W/System.err:     at android.widget.EditText.&lt;init&gt;(EditText.java:60)
  09-21 17:55:25.300 2550-2550/amrita.edu.ha W/System.err:     at android.support.v7.widget.AppCompatEditText.&lt;init&gt;(AppCompatEditText.java:60)
  09-21 17:55:25.300 2550-2550/amrita.edu.ha W/System.err:     at android.support.v7.widget.AppCompatEditText.&lt;init&gt;(AppCompatEditText.java:56)
  09-21 17:55:25.300 2550-2550/amrita.edu.ha W/System.err:     at android.support.v7.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:112)
  09-21 17:55:25.300 2550-2550/amrita.edu.ha W/System.err:     at android.support.v7.app.AppCompatDelegateImplV7.createView(AppCompatDelegateImplV7.java:980)
  09-21 17:55:25.300 2550-2550/amrita.edu.ha W/System.err:     at android.support.v7.app.AppCompatDelegateImplV7.onCreateView(AppCompatDelegateImplV7.java:1039)
  09-21 17:55:25.300 2550-2550/amrita.edu.ha W/System.err:     at android.support.v4.view.LayoutInflaterCompatHC$FactoryWrapperHC.onCreateView(LayoutInflaterCompatHC.java:44)
  09-21 17:55:25.301 2550-2550/amrita.edu.ha W/System.err:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:684)
  09-21 17:55:25.301 2550-2550/amrita.edu.ha W/System.err:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
  09-21 17:55:25.301 2550-2550/amrita.edu.ha W/System.err:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
  09-21 17:55:25.301 2550-2550/amrita.edu.ha W/System.err:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
  09-21 17:55:25.301 2550-2550/amrita.edu.ha W/System.err:     at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
  09-21 17:55:25.301 2550-2550/amrita.edu.ha W/System.err:     at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
  09-21 17:55:25.301 2550-2550/amrita.edu.ha W/System.err:     at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
  09-21 17:55:25.301 2550-2550/amrita.edu.ha W/System.err:     at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:280)
  09-21 17:55:25.301 2550-2550/amrita.edu.ha W/System.err:     at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
  09-21 17:55:25.301 2550-2550/amrita.edu.ha W/System.err:     at amrita.edu.ha.AddUser.onCreate(AddUser.java:55)
  09-21 17:55:25.301 2550-2550/amrita.edu.ha W/System.err:     at android.app.Activity.performCreate(Activity.java:5292)
  09-21 17:55:25.301 2550-2550/amrita.edu.ha W/System.err:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088)
  09-21 17:55:25.301 2550-2550/amrita.edu.ha W/System.err:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2302)
  09-21 17:55:25.302 2550-2550/amrita.edu.ha W/System.err:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)
  09-21 17:55:25.302 2550-2550/amrita.edu.ha W/System.err:     at android.app.ActivityThread.access$800(ActivityThread.java:151)
  09-21 17:55:25.302 2550-2550/amrita.edu.ha W/System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)
  09-21 17:55:25.302 2550-2550/amrita.edu.ha W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:110)
  09-21 17:55:25.302 2550-2550/amrita.edu.ha W/System.err:     at android.os.Looper.loop(Looper.java:193)
  09-21 17:55:25.302 2550-2550/amrita.edu.ha W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:5292)
  09-21 17:55:25.302 2550-2550/amrita.edu.ha W/System.err:     at java.lang.reflect.Method.invokeNative(Native Method)
  09-21 17:55:25.302 2550-2550/amrita.edu.ha W/System.err:     at java.lang.reflect.Method.invoke(Method.java:515)
  09-21 17:55:25.302 2550-2550/amrita.edu.ha W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824)
  09-21 17:55:25.302 2550-2550/amrita.edu.ha W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
  09-21 17:55:25.302 2550-2550/amrita.edu.ha W/System.err:     at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>The code is below</p>
  
  <pre><code>public class AddUser extends AppCompatActivity  {           //implements MultiSelectionSpinner.OnMultipleItemsSelectedListener
      private EditText et,et1,et2,et3,et4;
      private Button btn;
      private Spinner spinner;
      private ImageButton imgtbn;
      int i=0;
      List&lt;String&gt; list = new ArrayList&lt;&gt;();
      List&lt;String&gt; mylist=new ArrayList&lt;&gt;();
      List&lt;Integer&gt;nlist=new ArrayList&lt;&gt;();
      Integer myIntArray;
      HashMap&lt;String,Integer&gt; map=new HashMap&lt;String, Integer&gt;();
      Object objh="";
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          **setContentView(R.layout.adduser);**
  
          ClientResource clientResource=new ClientResource("http://10.30.9.208:8080/api/users/view_group");
      clientResource.setChallengeResponse(ChallengeScheme.HTTP_BASIC,
              "admin", "admin");
      clientResource.get();
      Response response= clientResource.getResponse();
  
      System.out.println("Response from server is ----&gt; "+response.getEntityAsText());
      JSONObject obj= null;
      try {
          obj = new JSONObject(response.getEntityAsText());
          String strMessage = (String) obj.get("message");
          JSONArray jarray = new JSONArray(strMessage);
          for (int i = 0; i &lt; jarray.length(); i++) {
              JSONObject obj1 = jarray.getJSONObject(i);
              list.add((String) obj1.get("group_name"));
              map.put((String)obj1.get("group_name"),(Integer)obj1.get("group_id"));
          }
          }catch(JSONException e){
              e.printStackTrace();
          }
  </code></pre>
  
  <p>The exception points to the statement enclosed in two stars.</p>