Note that there are some explanatory texts on larger screens.

plurals
  1. POandroid.os.networkexception on Main method
    primarykey
    data
    text
    <p>Below is my code:</p> <pre><code>private static final String TAG_TYPE = "movie_type"; private static final String TAG_NAME = "movie_name"; private static final String TAG_LENGTH = "movie_length"; private static final String TAG_SCHEDULES = "movie_schedules"; private static final String TAG_CINEMA = "movie_cinema_number"; private static final String TAG_URL = "movie_image_url"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); try { String readMovieSchedules = readMovieSchedules(); // Hashmap for ListView ArrayList&lt;HashMap&lt;String, String&gt;&gt; movieList = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;(); JSONArray jsonArray = new JSONArray(readMovieSchedules); Log.i(MainActivity.class.getName(), "Number of entries " + jsonArray.length()); for (int i = 0; i &lt; jsonArray.length(); i++) { JSONObject jsonObject = jsonArray.getJSONObject(i); Log.i(MainActivity.class.getName(), jsonObject.getString("movie_name")); // Storing each json item in variable String name = jsonObject.getString(TAG_NAME); String type = jsonObject.getString(TAG_TYPE); String length = jsonObject.getString(TAG_LENGTH); String cinema = jsonObject.getString(TAG_CINEMA); String schedules = jsonObject.getString(TAG_SCHEDULES); String url = jsonObject.getString(TAG_URL); // creating new HashMap HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;(); // adding each child node to HashMap key =&gt; value map.put(TAG_NAME, name); map.put(TAG_TYPE, type); map.put(TAG_LENGTH, length); map.put(TAG_CINEMA, cinema); map.put(TAG_SCHEDULES, schedules); map.put(TAG_URL, url); // adding HashList to ArrayList movieList.add(map); //String strURL = TAG_URL.replaceAll(" ", "%20"); /** * Updating parsed JSON data into ListView * */ ListAdapter adapter = new SimpleAdapter(MainActivity.this, movieList, R.layout.list_item, new String[] { TAG_NAME, TAG_CINEMA, TAG_SCHEDULES }, new int[] { R.id.name, R.id.cinema, R.id.schedules }); //new String[] {}, //new int[] {}); setListAdapter(adapter); // selecting single ListView item ListView lv = getListView(); // Launching new screen on Selecting Single ListItem lv.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) { // getting values from selected ListItem String name = ((TextView) view.findViewById(R.id.name)).getText().toString(); String cost = ((TextView) view.findViewById(R.id.cinema)).getText().toString(); String description = ((TextView) view.findViewById(R.id.schedules)).getText().toString(); //String url = ((TextView) view.findViewById(R.id.image_)).getText().toString(); // Starting new intent Intent in = new Intent(getApplicationContext(), SingleMenuItemActivity.class); in.putExtra(TAG_NAME, name); in.putExtra(TAG_CINEMA, cost); in.putExtra(TAG_SCHEDULES, description); //in.putExtra(TAG_URL, url); startActivity(in); } }); } } catch (Exception e) { e.printStackTrace(); } } </code></pre> <p>This code is working on SDK 8, but not working on 17. I'm stuck with this problem. Does anyone here know how to debug this? I'd gladly appreciate your help. thanks.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload