[Mono-bugs] [Bug 679789] New: mono-android-9794 -the application crash and i have runtime Exception of type ‘Java .Lang. NullPointerException’ was thrown .

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Mar 15 11:04:56 EDT 2011


https://bugzilla.novell.com/show_bug.cgi?id=679789

https://bugzilla.novell.com/show_bug.cgi?id=679789#c0


           Summary: mono-android-9794 -the application crash and i have
                    runtime Exception of type
                    ‘Java.Lang.NullPointerException’ was thrown.
    Classification: Mono
           Product: MonoDroid
           Version: unspecified
          Platform: Other
        OS/Version: Windows 7
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: Runtime
        AssignedTo: mkestner at novell.com
        ReportedBy: asmaa at victorylink.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1;
Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729;
Media Center PC 6.0; InfoPath.2; .NET4.0C; .NET4.0E)

1- i had created Main layout include TabHost
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@android:id/tabhost"
   android:layout_width="fill_parent"
    android:layout_height="fill_parent"
       >
  <LinearLayout
    android:orientation="vertical"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent"
     android:padding="5dp">
    <TabWidget
       android:id="@android:id/tabs"
       android:layout_width="fill_parent"
        android:layout_height="wrap_content"/>
    <FrameLayout
      android:id="@android:id/tabcontent"
     android:layout_width="fill_parent"
      android:layout_height="fill_parent"
     android:padding="5dp"/>

  </LinearLayout>
</TabHost>

2- in Activity i wrote 
  protected override void OnCreate(Bundle bundle)
        {
                base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);
            TabHost host = new TabHost(this); // assuming inside Activity..
            TabHost.TabSpec spec;     // Resusable TabSpec for each tab   
            Intent intent;            // Reusable Intent for each tab   
            // Create an Intent to launch an Activity for the tab 
            intent = new Intent(this, typeof(MyHelloView));
            intent.AddFlags(ActivityFlags.NewTask);
            // Initialize a TabSpec for each tab and add it to the TabHost   
            spec = host.NewTabSpec("MyHelloView");
            spec.SetIndicator("Hello",
Resources.GetDrawable(Resource.Drawable.Icon));
            spec.SetContent(intent);
            host.AddTab(spec);
        }

3- after i deploy application the application crash and i have runtime
exception
Exception of type ‘Java.Lang.NullPointerException’ was thrown.
At Android.Runtime.JNIEnv.CallVoidMethod(IntPtr jobject, IntPtr jmethod,
Android.Runtime.JValue[] params)[0x00023] in
/home/jpobst/Desktop/mondroid/Mono. Android/src/Runtime/JNIEnv.cs:524
At Android.Widget.TabHost.Add(Android.Widget.TabSpec tabSpec)[0x0003e] in
/home/jpobst/Desktop/mondroid/Mono. Android/platforms/android-8/src/generated/
Android.Widget.TabHost.cs:790


Reproducible: Always

Steps to Reproduce:
1.
2.
3.
Actual Results:  
Exception of type ‘Java.Lang.NullPointerException’ was thrown.
At Android.Runtime.JNIEnv.CallVoidMethod(IntPtr jobject, IntPtr jmethod,
Android.Runtime.JValue[] params)[0x00023] in
/home/jpobst/Desktop/mondroid/Mono. Android/src/Runtime/JNIEnv.cs:524
At Android.Widget.TabHost.Add(Android.Widget.TabSpec tabSpec)[0x0003e] in
/home/jpobst/Desktop/mondroid/Mono. Android/platforms/android-8/src/generated/
Android.Widget.TabHost.cs:790



TabHost was working correctly before i install latest version of
mono-android-9794

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list