title: Open JSON-File InternalStorage from different Activity (Android)
body: <p>My point it's the next. I just download a json file from the server when login it's done. I save it with the next code in activity login.class :</p>
  
  <pre><code>JSONObject json2 = jsonParser2.getJSONFromUrl(URL);
  //3
  try {
    FileOutputStream fos = openFileOutput("news.json", Context.MODE_PRIVATE);
    fos.write(json2.toString().getBytes());
    fos.close();
  } catch (IOException e) {
    e.printStackTrace();
  }
  </code></pre>
  
  <p>I just check in <code>/data/data/myapp/files/news.json</code> and the file is created with the right data.</p>
  
  <p>My problem is in the next activity (A different activity). In this one I want to read the file and put it in a listview, but android emulator/device crashed when it's trying to access the file. (This is my code):</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_noticias);
      try {
        JSONObject obj = new JSONObject(loadJSONFromAsset());
      } catch (JSONException e) {
        e.printStackTrace(); 
      }
  }
  
  
  public String loadJSONFromAsset() {
      String json = null;
      try {
          InputStream is = getAssets().open("news.json");
          int size = is.available();
          byte[] buffer = new byte[size];
          is.read(buffer);
          is.close();
          json = new String(buffer, "UTF-8");
  
      } catch (IOException ex) {
          ex.printStackTrace();
          return null;
      }
      return json;
  }
  </code></pre>
  
  <p>Please, can someone help me with this issue ?? How can i fixed or someone knows another method to read the file ??</p>
  
  <p>Thanks for u time.</p>