Note that there are some explanatory texts on larger screens.

plurals
  1. POJava.lang.NullPointerException at getapplicationContext() while initiating adapter
    primarykey
    data
    text
    <p>While running the project on Android emulator,I face the exception as java.lang.NullPointerException at getApplicationContext.Please help me to resolve this issue.</p> <p><strong>Error</strong></p> <pre><code>07-19 15:08:07.811: D/AndroidRuntime(366): Shutting down VM 07-19 15:08:07.811: W/dalvikvm(366): threadid=1: thread exiting with uncaught exception (group=0x4001d800) 07-19 15:08:07.841: E/AndroidRuntime(366): FATAL EXCEPTION: main 07-19 15:08:07.841: E/AndroidRuntime(366): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.TfsMutualFund/org.TfsMutualFund.loading}: java.lang.NullPointerException 07-19 15:08:07.841: E/AndroidRuntime(366): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585) 07-19 15:08:07.841: E/AndroidRuntime(366): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) 07-19 15:08:07.841: E/AndroidRuntime(366): Caused by: java.lang.NullPointerException 07-19 15:08:07.841: E/AndroidRuntime(366): at android.content.ContextWrapper.getApplicationContext(ContextWrapper.java:100) 07-19 15:08:07.841: E/AndroidRuntime(366): at org.TfsMutualFund.loading.&lt;init&gt;(loading.java:23) </code></pre> <p><strong>AndroidManifest.xml</strong></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.TfsMutualFund"&gt; &lt;uses-sdk android:targetSdkVersion="8" /&gt; &lt;application android:name=".globalAdapter" android:icon="@drawable/icon" android:label="@string/app_name"&gt; &lt;activity android:name=".loading" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar" android:configChanges="orientation|keyboard|keyboardHidden"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name=".TFSManinActivity" android:configChanges="orientation|keyboard|keyboardHidden"/&gt; &lt;/application&gt; </code></pre> <p></p> <p><strong>loading.java</strong></p> <pre><code>package org.TfsMutualFund; public class loading extends Activity{ private static ArrayAdapter&lt;String&gt; adapter; private globalAdapter adpt = ((globalAdapter)getApplicationContext()); private String ServicePath = adpt.getServicePath(); private String ServiceName = adpt.getServiceName(); @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.loading); if(isOnline()) new AsyncLoad().execute(); else </code></pre>
    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.
    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