» »

[Android]InflateException

[Android]InflateException

KernelPanic ::

Spostovani!

Ko hocem pognati nek activity v svoji aplikaciji:
    @Override
    public void onCreate(Bundle icicle)
    {
        super.onCreate(icicle);

        try
        {
            setContentView(R.layout.cactivityregisterscreen);
            this.setEditTextBirthDate((EditText)findViewById(R.id.birthdate));
        }
        catch(Exception ex)
        {
            Log.e(CActivityRegisterScreen.m_strLogTag,
                  ex.getClass().getName()+":"+
                  ex.getMessage().toString());
        }
        finally
        {
        }   // try-catch-false
    }   // onCreate
, mi v vrstici setContentView.. pride do sledecega exceptiona:
"android.view.InflateException:Binary XML file line #30: Error inflating class unknown"
Kaj ta exception pomeni in kako se ga resim?

Lp,
M.

FrEaKmAn ::

glede na podano bi ocenu, da je v cactivityregisterscreen.xml napaka. Lahko še to objaviš?

KernelPanic ::

Evo ga:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:fillViewport="true">
    <RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="#000000">

        <!-- Logo Start-->
        <ImageView android:src="@drawable/logo"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="10dip"
        />
        <!-- Logo Ends -->

        <!-- Registration form -->
        <LinearLayout
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="10dip"
        >

            <!-- Surname Field -->
            <EditText android:id="@+id/field_surname"
                      android:layout_width="fill_parent"
                      android:layout_height="wrap_content"
                      android:layout_marginTop="5dip"
                      android:layout_marginBottom="20dip"
                      android:hint="@string/label_lastname_si"
                      android:inputMethod="textCapSentences"
                      android:singleLine="true"/>

            <!-- Name Field -->
            <EditText android:id="@+id/field_name"
                      android:layout_width="fill_parent"
                      android:layout_height="wrap_content"
                      android:layout_marginTop="5dip"
                      android:layout_marginBottom="20dip"
                      android:hint="@string/label_name_si"
                      android:inputMethod="textCapSentences"
                      android:singleLine="true"/>

            <!-- Email Field -->
            <EditText android:id="@+id/field_email"
                      android:layout_width="fill_parent"
                      android:layout_height="wrap_content"
                      android:layout_marginTop="5dip"
                      android:layout_marginBottom="20dip"
                      android:inputType="textEmailAddress"
                      android:hint="@string/label_email_si"
                      android:singleLine="true"/>

            <!-- Gender Selector Radio Group -->
            <RadioGroup android:id="@+id/group_genderselection"
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        android:orientation="horizontal"
                        android:text="@string/label_gender_si">

                        <RadioButton android:id="@+id/item_male"
                                     android:layout_width="wrap_content"
                                     android:layout_height="wrap_content"
                                     android:text="@string/label_gender_male_si"
                                     android:checked="true"
                        />

                        <RadioButton android:id="@+id/item_female"
                                     android:layout_width="wrap_content"
                                     android:layout_height="wrap_content"
                                     android:text="@string/label_gender_female_si"
                                     android:checked="false"
                        />
            </RadioGroup>

            <!-- Bithdate Entry Field - invokes DatePicker dialog -->
            <EditText android:id="@+id/birthdate"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_marginTop="5dip"
                      android:singleLine="true"
                      android:password="false"
                      android:hint="@string/label_birthdate_si"
                      android:editable="false"
                      android:onClick="onDateSelectClick"
            />

            <!--  Password Label -->
            <EditText android:id="@+id/field_password"
                      android:layout_width="fill_parent"
                      android:layout_height="wrap_content"
                      android:layout_marginTop="5dip"
                      android:singleLine="true"
                      android:password="true"
                      android:hint="@string/label_password_si"
            />

            <!-- Button "Register" - adds new user to database -->
            <Button android:id="@+id/btnRegisterNewUser"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dip"
                    android:text="@string/label_registernewuser_si"
                    android:onClick="onBtnRegisterNewUserClick"
            />
        </LinearLayout>
        <!-- Register Form Ends -->
    </RelativeLayout>
</ScrollView>
Pa glede na to, da je to prva aplikacija, lahko tudi skritiziras ta moj registration acitvity, za registracijo uporabvnika v sistem (dodajanje le tega v bazo). Ali se to tako dela z fieldi ali obstaja kak drugacna androidova filozofija?

Lp,
M.

Nihce ne ve?

Zgodovina sprememb…



Vredno ogleda ...

TemaSporočilaOglediZadnje sporočilo
TemaSporočilaOglediZadnje sporočilo
»

[Android] Bluetooth aplikacija

Oddelek: Programiranje
51080 (943) marjan_h
»

Android - Začetnik

Oddelek: Programiranje
111770 (1095) hurlimannxt
»

[Android] setText iz AsyncTask

Oddelek: Programiranje
7839 (756) golobich
»

android črta

Oddelek: Programiranje
412389 (1660) g333kk
»

[Android]Cudno obnasanje aplikacije in emulatorja

Oddelek: Programiranje
71302 (1131) KernelPanic

Več podobnih tem