Why my Toast Not Displaying
<p>In the following code, my toast is not displayed. However, I get the error, "RuntimeException: Can't create handler inside thread that has not called Looper.prepare()".
I tried <code>Add_City.this</code> and <code>getApplicationContext</code></p>

<pre><code>try {
                BufferedReader reader = new BufferedReader(
                        new InputStreamReader(is, "iso-8859-1"), 8);
                StringBuilder sb = new StringBuilder();
                while ((line = reader.readLine()) != null) {
                    sb.append(line + "\n");
                }
                is.close();
                result = sb.toString();

                JSONObject json_data = new JSONObject(result);
                code=(json_data.getInt("code"));
                System.out.println(code);
                if(code==1)
                {
                    Toast.makeText(Add_City.this, "Inserted Successfully",Toast.LENGTH_SHORT).show();
                }
                else
                {
                    Toast.makeText(Add_City.this, "Sorry, City Already Available",Toast.LENGTH_LONG).show();
                }
                Log.i("TAG", "Result Retrieved");
            } catch (Exception e) {
                Log.i("TAG", e.toString());
            }
</code></pre>