Thanks imran, your suggestion works!  now dialog_activity.java has no
error.

But i faced another error in my main.xml after I post the above
message and before i saw your answer. The main.xml is still exactly
the same as above, but i played around with AndroidManifest.xml (and i
forgot what i changed for it!!). now AndroidManifest.xml has also no
error, but main.xml shows 1 error (pointed to line <TextView
xmlns:android="http://schemas.android.com/apk/res/android"; ). the
error says:

no resource found that matches the given name (at 'text' with value
'@string/dialog_activity_text')

Is it because I changed AndroidManifest.xml ?

My current AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android";
      package="com.iqq.adc.dialog_activity"
      android:versionCode="1"
      android:versionName="1.0.0">
    <application android:icon="@drawable/icon" android:label="@string/
app_name">
        <activity android:name="dialog_activity">
            <intent-filter android:label="@layout/main">
                <action android:name="android.intent.action.MAIN" />
                <category
android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>



On Oct 14, 1:46 pm, Imran <[EMAIL PROTECTED]> wrote:
> Hi Mushimi
>
>        change setContentView(R.layout.dialog_activity);  to
> setContentView(R.layout.main);
>
> On Oct 12, 9:21 pm, mushimi <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi,
>
> > I follow sample "Dialog Activity" and have one error as this message's
> > title. Can someone help me to have a look?
>
> > My dialog_activity.java, main.xml and R.java as below:
>
> > My dialog_activity.java:
> > package com.iqq.adc.dialog_activity;
> > import android.app.Activity;
> > import android.os.Bundle;
> > import android.view.Window;
> > public class dialog_activity extends Activity {
> >     @Override
> >         protected void onCreate(Bundle savedInstanceState) {
> >         super.onCreate(savedInstanceState);
> >         requestWindowFeature(Window.FEATURE_LEFT_ICON);
> >         setContentView(R.layout.dialog_activity);
>
> > getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON,
> >                 android.R.drawable.ic_dialog_alert);
> >     }
>
> > }
>
> > My main.xml:
> > <?xml version="1.0" encoding="utf-8"?>
> > <TextView xmlns:android="http://schemas.android.com/apk/res/android";
> > android:id="@+id/text"
> > android:layout_width="fill_parent"
> > android:layout_height="fill_parent"
> > android:gravity="center_vertical|center_horizontal"
> > android:text="@string/dialog_activity_text"/>
>
> > My R.java:
> > package com.iqq.adc.dialog_activity;
> > public final class R {
> >     public static final class attr {
> >     }
> >     public static final class drawable {
> >         public static final int icon=0x7f020000;
> >     }
> >     public static final class id {
> >         public static final int text=0x7f050000;
> >     }
> >     public static final class layout {
> >         public static final int main=0x7f030000;
> >     }
> >     public static final class string {
> >         public static final int app_name=0x7f040001;
> >         public static final int hello=0x7f040000;
> >     }
>
> > }- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to