I am developing an application for different medical tests. However when I start running the app on the emulator it shows "Unfortunately the app has stopped working-> OK" But after a few seconds it runs . Whenever I go to the main screen it shows the above message. However after I press ok the app runs as it is. There are no errors or warnings shown on eclipse. I have attached the manifest file. Can someone help me please??

**The manifest file is as follows:**

```
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.mobility.ui"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="19" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" 

        android:theme="@style/AppTheme" >
        <activity
            android:name="com.mobility.ui.MainActivity"
            android:screenOrientation="portrait"
            android:launchMode="singleInstance"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity android:name="com.mobility.ui.VTest"
            android:launchMode="singleInstance"
            android:screenOrientation="portrait"
            ></activity>

        <activity android:name="com.mobility.ui.ITest"
            android:launchMode="singleInstance"
            android:screenOrientation="portrait"
            ></activity>

        <activity android:name="com.mobility.ui.ATest"
            android:launchMode="singleInstance"
            android:screenOrientation="portrait"
            ></activity>

        <activity android:name="com.mobility.ui.Test"
            android:launchMode="singleInstance"
            android:screenOrientation="portrait"
            ></activity>

    </application>

</manifest>

```

**Logcat:-**

```
08-14 00:17:12.120: E/AndroidRuntime(1345):     at java.lang.reflect.Method.invokeNative(Native Method)
08-14 00:17:12.120: E/AndroidRuntime(1345):     at java.lang.reflect.Method.invoke(Method.java:515)
08-14 00:17:12.120: E/AndroidRuntime(1345):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
08-14 00:17:12.120: E/AndroidRuntime(1345):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
08-14 00:17:12.120: E/AndroidRuntime(1345):     at dalvik.system.NativeStart.main(Native Method)
08-14 00:17:12.120: E/AndroidRuntime(1345): Caused by: java.lang.IllegalArgumentException: Receiver not registered: com.igate.mobility.visiontest.ui.UIScreenActivity$1@b2ce2338
08-14 00:17:12.120: E/AndroidRuntime(1345):     at android.app.LoadedApk.forgetReceiverDispatcher(LoadedApk.java:667)
08-14 00:17:12.120: E/AndroidRuntime(1345):     at android.app.ContextImpl.unregisterReceiver(ContextImpl.java:1453)
08-14 00:17:12.120: E/AndroidRuntime(1345):     at android.content.ContextWrapper.unregisterReceiver(ContextWrapper.java:489)
08-14 00:17:12.120: E/AndroidRuntime(1345):     at com.igate.mobility.visiontest.ui.UIScreenActivity.onPause(UIScreenActivity.java:55)
08-14 00:17:12.120: E/AndroidRuntime(1345):     at android.app.Activity.performPause(Activity.java:5335)
08-14 00:17:12.120: E/AndroidRuntime(1345):     at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1233)
08-14 00:17:12.120: E/AndroidRuntime(1345):     at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3048)

```

The UISCreenActivity.java file:

```
private BroadcastReceiver receiver = new BroadcastReceiver() {

        @Override
        public void onReceive(Context context, Intent intent) {
          Bundle bundle = intent.getExtras();
          if (bundle != null) {

//            String string = bundle.getString(DownloadService.FILEPATH);
//          int resultCode = bundle.getInt(DownloadService.RESULT);
//          
//          if (resultCode == RESULT_OK) {
//            
//              Toast.makeText(getApplicationContext(),"Download complete. Download URI: " + string,
//                Toast.LENGTH_LONG).show();
//            
////              textView.setText("Download done");
//          } else {
//            Toast.makeText(getApplicationContext(), "Download failed",Toast.LENGTH_LONG).show();
////              textView.setText("Download failed");
//          }
//          

          }
        }
      };

      @Override
      protected void onResume() {
        super.onResume();

//      registerReceiver(receiver, new IntentFilter(DownloadService.NOTIFICATION));

      }

      @Override
      protected void onPause() {
          if(receiver != null) {
            unregisterReceiver(receiver);
          }
        }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
//      overridePendingTransition(R.anim.anim_in,R.anim.anim_out);
    }

    public abstract void setObjects();

    // setting click listener to a view
    public void setOnClickListener(int[] viewIds){
        for (int i = 0; i < viewIds.length; i++) {
            ((View)findViewById(viewIds[i])).setOnClickListener(this);
        }
    }

    public void setInvisible(int viewId){
        ((View)findViewById(viewId)).setVisibility(View.INVISIBLE);
    }

}

```